/*
 * The landing page (landing/index): what Tailwind's utilities don't cover.
 * Loaded only by layouts/landing. Every rule is scoped to body.landing and
 * every class starts with lp- so nothing reaches the portal. All motion is
 * off under prefers-reduced-motion: the animations and transitions only exist
 * inside the no-preference media query. The looping ones pause with the
 * marquee's pause button (body.lp-paused).
 */

/* Links dim a little under the pointer (only on devices that can hover: a
   tap on a phone would leave the link dimmed) */
@media (hover: hover) {
  .landing a:hover { opacity: 0.85; }
}

.landing a:focus-visible,
.landing button:focus-visible,
.landing input:focus-visible,
.landing pre:focus-visible { outline: 3px solid #040404; outline-offset: 3px; }
.landing .lp-on-dark a:focus-visible,
.landing .lp-on-dark button:focus-visible,
.landing .lp-on-dark pre:focus-visible { outline-color: #FFFFFF; }

/* Grids: features bento (4 → 2 → 1 columns), how-it-works steps, the funnel */
.landing .lp-bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.landing .lp-span2x2 { grid-column: span 2; grid-row: span 2; }
.landing .lp-span2 { grid-column: span 2; }
.landing .lp-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.landing .lp-funnel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 980px) {
  .landing .lp-funnel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .landing .lp-funnel-rail { display: none !important; }
  .landing .lp-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .landing .lp-steps { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .landing .lp-nav-secondary { display: none; }
}

/* Pricing: the plan cards (3 → 1 columns) and the questions (2 → 1) */
.landing .lp-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.landing .lp-faq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; }
@media (max-width: 1040px) {
  .landing .lp-plans, .landing .lp-faq { grid-template-columns: minmax(0, 1fr); }
}

/* The estimator's slider: an ink track and an accent thumb, 44px tall to tap */
.landing .lp-range { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; margin: 0; background: transparent; cursor: pointer; }
.landing .lp-range::-webkit-slider-runnable-track { height: 4px; background: #040404; }
.landing .lp-range::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -12px; border-radius: 999px; background: #8E8EFF; border: 3px solid #040404; }
.landing .lp-range::-moz-range-track { height: 4px; background: #040404; }
.landing .lp-range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 999px; background: #8E8EFF; border: 3px solid #040404; }

/* The questions: a plus that turns into a cross when open */
.landing .lp-faq-item summary { list-style: none; cursor: pointer; }
.landing .lp-faq-item summary::-webkit-details-marker { display: none; }
.landing .lp-faq-item summary:focus-visible { outline: 3px solid #040404; outline-offset: 3px; }
.landing .lp-faq-item[open] .lp-chev { transform: rotate(45deg); }
@media (max-width: 640px) {
  .landing .lp-diamonds { display: none !important; }
}
@media (max-width: 620px) {
  .landing .lp-funnel { grid-template-columns: minmax(0, 1fr); }
  .landing .lp-bento { grid-template-columns: minmax(0, 1fr); }
  .landing .lp-span2x2, .landing .lp-span2 { grid-column: auto; grid-row: auto; }
}

@media (prefers-reduced-motion: no-preference) {
  /* Analytics: the sparkline and the platform bars moving to the range picked */
  .landing .lp-spark { transition: d 0.6s ease; }
  .landing .lp-bar { transition: width 0.6s cubic-bezier(.2,.8,.2,1); }

  /* Pricing: a question's plus turning */
  .landing .lp-chev { transition: transform 0.2s; }

  /* Funnel rail: a square travels from the ad to the conversion */
  .landing .lp-flow { animation: lp-flow 8s linear infinite; }
  @keyframes lp-flow { 0% { left: 0; } 100% { left: calc(100% - 10px); } }

  /* Hero: the click square drops onto the picked device row (0, 1, 2) */
  .landing .lp-arrive0 { animation: lp-arrive0 0.8s cubic-bezier(.5,0,.2,1) both; }
  .landing .lp-arrive1 { animation: lp-arrive1 0.8s cubic-bezier(.5,0,.2,1) both; }
  .landing .lp-arrive2 { animation: lp-arrive2 0.8s cubic-bezier(.5,0,.2,1) both; }
  @keyframes lp-arrive0 { 0% { transform: translateY(-64px); opacity: 0; } 25% { opacity: 1; } 100% { transform: translateY(0); opacity: 1; } }
  @keyframes lp-arrive1 { 0% { transform: translateY(-128px); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(0); opacity: 1; } }
  @keyframes lp-arrive2 { 0% { transform: translateY(-192px); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(0); opacity: 1; } }

  /* A phone screen sliding in when its content changes */
  .landing .lp-screen-in { animation: lp-screen-in 0.5s cubic-bezier(.2,.8,.2,1) both; }
  @keyframes lp-screen-in { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

  /* Square pattern: squares turn into diamonds in a wave (stagger with animation-delay) */
  .landing .lp-wave { animation: lp-wave 5s ease-in-out infinite; }
  @keyframes lp-wave { 0% { transform: rotate(0deg); } 18% { transform: rotate(45deg); } 36% { transform: rotate(0deg); } 100% { transform: rotate(0deg); } }

  .landing .lp-pulse { animation: lp-pulse 1.8s ease-out infinite; }
  @keyframes lp-pulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,0.55); } 100% { box-shadow: 0 0 0 10px rgba(255,255,255,0); } }

  /* A square traveling down a vertical line */
  .landing .lp-traveler { animation: lp-travel 2.6s cubic-bezier(.6,0,.4,1) infinite; }
  @keyframes lp-travel { 0% { top: 0; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { top: calc(100% - 10px); opacity: 0; } }

  /* Destination marquee: the list is rendered twice, so -50% loops seamlessly */
  .landing .lp-marquee { animation: lp-marquee 32s linear infinite; }
  @keyframes lp-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

  /* Analytics sparkline drawing itself, left to right. A wipe rather than a
     stroke-dasharray: the line keeps a non-scaling stroke in a stretched
     viewBox, so its dashes are measured on screen and a pathLength-based
     dash only ever covered part of it. */
  .landing .lp-draw { animation: lp-draw 1.8s ease-out both; }
  @keyframes lp-draw { from { clip-path: inset(-4px 100% -4px -4px); } to { clip-path: inset(-4px -4px -4px -4px); } }

  /* Funnel cards lighting up in turn (stagger with animation-delay 0/2/4/6s) */
  .landing .lp-seq { animation: lp-seq 8s ease-in-out infinite; opacity: 0.32; }
  @keyframes lp-seq { 0% { opacity: 0.32; } 4%, 24% { opacity: 1; } 28%, 100% { opacity: 0.32; } }

  .landing .lp-caret { animation: lp-caret 1s steps(1) infinite; }
  @keyframes lp-caret { 50% { opacity: 0; } }

  /* Install attribution: the match pill sliding in */
  .landing .lp-match { animation: lp-match 4s ease-in-out infinite; }
  @keyframes lp-match { 0%, 20% { transform: translateX(-12px); opacity: 0; } 35%, 85% { transform: translateX(0); opacity: 1; } 100% { transform: translateX(0); opacity: 0; } }

  /* The pause button beside the marquee (landing--motion) stops every loop */
  .landing.lp-paused .lp-flow,
  .landing.lp-paused .lp-wave,
  .landing.lp-paused .lp-pulse,
  .landing.lp-paused .lp-traveler,
  .landing.lp-paused .lp-marquee,
  .landing.lp-paused .lp-seq,
  .landing.lp-paused .lp-caret,
  .landing.lp-paused .lp-match { animation-play-state: paused; }

  /* The marquee also stops under the pointer, to read a destination */
  @media (hover: hover) {
    .landing .lp-marquee:hover { animation-play-state: paused; }
  }
}
