/* Activepieces style animations and variables */
:root {
  --color-ink-300: #d4d4d8;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.dot-grid {
  background-image: radial-gradient(var(--color-ink-300) 1px, transparent 1px);
  background-size: 20px 20px;
  -webkit-mask-image: radial-gradient(80% 80% at 50% 30%, #000 40%, transparent 100%);
  mask-image: radial-gradient(80% 80% at 50% 30%, #000 40%, transparent 100%);
}

.animate-marquee {
  animation: marquee 60s linear infinite;
}

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

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

.animate-float {
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0); }
}

/* Intersection observer reveal class handled by main.js */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

:root {
  --ink: #09090b;
  --ink-soft: #565F58;
  --ink-faint: #8A9189;
  --paper: #ffffff;
  --surface: #ffffff;
  --tint: #f4f4f5;
  --tint-2: #E9ECE4;
  --line: #E4E6DD;
  --line-strong: #CFD3C6;
  --brand: #0F6E56;
  --brand-deep: #0A4A3A;
  --brand-ink: #062A21;
  --brand-light: #E3F1EC;
  --brand-mid: #BFE3D6;
  --amber: #92650B;
  --amber-light: #FDF0DD;
  --red: #B03A2A;
  --red-light: #FDE2DD;
  --blue: #155E9A;
  --blue-light: #DCEEFB;
  --violet: #5B3FA8;
  --violet-light: #E9E4F5;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.font-mono { font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }
h1, h2, h3, .tight { letter-spacing: -0.035em; }
@media (max-width: 639px) {
  h1, h2, h3, .tight { letter-spacing: -0.025em; }
  body { font-size: 15px; }
}
::selection { background-color: var(--brand-light); color: var(--brand-ink); }

/* ── Live ticker strip ── */
.ticker-strip {
  background: var(--ink);
  color: var(--brand-light);
  overflow: hidden;
  white-space: nowrap;
  border-bottom: 1px solid #1A2420;
}
.ticker-track {
  display: inline-flex;
  gap: 2.5rem;
  padding: 0.5rem 0;
  animation: ticker-scroll 60s linear infinite;
}
.ticker-strip:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.ticker-item { font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em; opacity: 0.9; }
.ticker-up { color: #7BE6B8; }
.ticker-down { color: #F0958A; }

/* ── App-matched entrance animations (from app.recurringtrade.com /waitlist) ── */
@keyframes fadeIn { 0% { opacity: 0; } 100% { opacity: 1; } }
@keyframes fadeUp { 0% { opacity: 0; transform: translateY(18px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes swapIn { 0% { opacity: 0; transform: translateY(10px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes app-ping { 75%, 100% { transform: scale(2); opacity: 0; } }

.fade-in-el { animation: fadeIn 0.8s ease both; }
.fade-up { animation: fadeUp 0.55s ease both; }
.fade-up-d0 { animation-delay: 0s; }
.fade-up-d1 { animation-delay: 0.05s; }
.fade-up-d2 { animation-delay: 0.12s; }
.fade-up-d3 { animation-delay: 0.18s; }
.fade-up-d4 { animation-delay: 0.24s; }
.swap-in { animation: swapIn 0.35s ease both; }

.ping-badge {
  position: relative; display: inline-flex; height: 0.375rem; width: 0.375rem;
}
.ping-badge-ring {
  position: absolute; display: inline-flex; height: 100%; width: 100%; border-radius: 999px;
  background: #3ECF8E; opacity: 0.6;
  animation: app-ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.ping-badge-dot {
  position: relative; display: inline-flex; height: 0.375rem; width: 0.375rem;
  border-radius: 999px; background: #3ECF8E;
}

/* Legibility over the moving chart line */
.chart-legible { text-shadow: 0 2px 14px rgba(6, 10, 8, 0.85), 0 1px 3px rgba(6, 10, 8, 0.9); }

/* Form stands out on its own over the moving chart — no wrapping box,
   just a near-opaque fill + a lifted glow so it reads at a glance. */
.hero-input {
  background: rgba(6, 10, 8, 0.92);
  border: 1.5px solid rgba(62, 207, 142, 0.55);
  box-shadow: 0 10px 28px -8px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(0, 0, 0, 0.3);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.hero-input:focus {
  outline: none;
  border-color: #3ECF8E;
  box-shadow: 0 10px 28px -8px rgba(0, 0, 0, 0.65), 0 0 0 3px rgba(62, 207, 142, 0.25);
}
.hero-btn {
  box-shadow: 0 10px 28px -8px rgba(0, 0, 0, 0.65), 0 0 22px rgba(15, 110, 86, 0.55);
}

/* Ticker bar — matched to the app's TickerBar component */
.app-ticker-bar {
  overflow: hidden;
  width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: #0B120F;
}
.app-ticker-track {
  display: flex;
  white-space: nowrap;
  width: max-content;
  padding: 0.5rem 0;
  animation: ticker-scroll 60s linear infinite;
}
.app-ticker-bar:hover .app-ticker-track { animation-play-state: paused; }
.app-ticker-item {
  display: inline-flex; align-items: center; gap: 0.375rem;
  margin: 0 1.25rem; font-size: 0.75rem; font-family: 'JetBrains Mono', monospace;
}
.app-ticker-sym { color: rgba(255, 255, 255, 0.5); font-weight: 600; letter-spacing: 0.04em; }
.app-ticker-val-up { color: #3ECF8E; font-weight: 500; }
.app-ticker-val-down { color: #F07070; font-weight: 500; }

/* ── Nav ── */
.nav-blur {
  background: rgba(250, 250, 247, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-link { position: relative; }
.nav-link::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px;
  background: var(--brand); transform: scaleX(0); transform-origin: left;
  transition: transform 0.2s ease;
}
.nav-link:hover::after { transform: scaleX(1); }

/* ── Buttons ── */
.btn-brand {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  background-color: var(--brand); color: #FFFFFF;
  font-weight: 700; border-radius: 0.65rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  box-shadow: 0 1px 2px rgba(10, 74, 58, 0.15);
}
.btn-brand:hover { background-color: var(--brand-deep); transform: translateY(-1px); box-shadow: 0 10px 20px -8px rgba(10, 74, 58, 0.45); }

.btn-dark {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  background-color: var(--ink); color: #FFFFFF;
  font-weight: 600; border-radius: 0.65rem;
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.btn-dark:hover { background-color: #1D2A24; transform: translateY(-1px); }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  background: transparent; color: var(--ink);
  border: 1px solid var(--line-strong); font-weight: 600; border-radius: 0.65rem;
  transition: all 0.15s ease;
}
.btn-ghost:hover { background-color: var(--tint); border-color: var(--ink-faint); }

/* ── Kicker ── */
.kicker {
  font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.09em; text-transform: uppercase; color: var(--brand);
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.kicker::before { content: ''; width: 6px; height: 6px; border-radius: 999px; background: var(--brand); display: inline-block; }
.kicker-dark { color: var(--brand-mid); }
.kicker-dark::before { background: var(--brand-mid); }

/* ── Dotted hero backdrop ── */
.dotted-panel {
  position: relative;
  background-color: var(--tint);
  background-image: radial-gradient(circle, var(--line-strong) 1px, transparent 1px);
  background-size: 20px 20px;
  border-radius: 1.5rem;
  border: 1px solid var(--line);
}
.dotted-panel::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 40%, transparent 30%, var(--tint) 88%);
  pointer-events: none; border-radius: 1.5rem; z-index: 1;
}
.dotted-panel { animation: fade-in-panel 0.8s ease both; }
@keyframes fade-in-panel { from { opacity: 0; } to { opacity: 1; } }

/* Full-bleed modifier: same backdrop, no card framing.
   Uses a doubled-up selector so it always beats .dotted-panel-dark / .dotted-panel
   on specificity, regardless of source order. */
.dotted-panel-full.dotted-panel-full { border-radius: 0; border: none; }

/* Used where the live canvas chart replaces the dot grid as the bg texture */
.chart-bg { background-image: none; }
.dotted-panel-full.dotted-panel-full::before { border-radius: 0; }

/* Animated backdrop: drifting dot grid + a slow-moving glow */
.dotted-animated { animation: fade-in-panel 0.8s ease both, dot-drift 22s linear infinite; }
@keyframes dot-drift { from { background-position: 0 0; } to { background-position: 40px 40px; } }
.dotted-animated::after {
  content: ''; position: absolute; z-index: 0; pointer-events: none;
  width: 55%; aspect-ratio: 1; border-radius: 999px; top: -8%; left: 18%;
  background: radial-gradient(circle, rgba(15, 110, 86, 0.18), transparent 70%);
  filter: blur(6px);
  animation: glow-drift 16s ease-in-out infinite alternate;
}
.dotted-animated.dotted-panel-dark::after {
  background: radial-gradient(circle, rgba(123, 230, 184, 0.14), transparent 70%);
}
@keyframes glow-drift {
  0%   { transform: translate(-8%, -4%) scale(0.95); }
  50%  { transform: translate(14%, 10%) scale(1.15); }
  100% { transform: translate(-4%, 12%) scale(1); }
}

/* Dark variant, for CTA / waitlist sections */
.dotted-panel-dark {
  position: relative;
  background-color: #0F1815;
  background-image: radial-gradient(circle, #24352C 1.4px, transparent 1.4px);
  background-size: 20px 20px;
  border-radius: 1.5rem;
  border: 1px solid #1E362C;
}
.dotted-panel-dark::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 35%, transparent 25%, #0F1815 90%);
  pointer-events: none; border-radius: 1.5rem;
}

/* ── Collage fragments (Ramp-style overlapping card stack) ── */
@keyframes float-y { 0%, 100% { transform: scale(1) translateY(0) rotate(var(--r, 0deg)); } 50% { transform: scale(1) translateY(-8px) rotate(var(--r, 0deg)); } }
@keyframes pop-in {
  0% { opacity: 0; transform: scale(0.7) translateY(28px) rotate(var(--r, 0deg)); }
  55% { opacity: 1; transform: scale(1.07) translateY(-6px) rotate(var(--r, 0deg)); }
  80% { transform: scale(0.98) translateY(1px) rotate(var(--r, 0deg)); }
  100% { opacity: 1; transform: scale(1) translateY(0) rotate(var(--r, 0deg)); }
}
.collage-card {
  position: absolute; background: #FFFFFF; border: 1px solid var(--line);
  border-radius: 0.85rem; box-shadow: 0 14px 26px -12px rgba(11, 18, 15, 0.22);
  padding: 0.65rem 0.9rem; opacity: 0;
  animation-name: pop-in, float-y;
  animation-duration: 0.7s, 5.6s;
  animation-delay: var(--pop-delay, 0.3s), calc(var(--pop-delay, 0.3s) + 0.65s);
  animation-timing-function: cubic-bezier(.22,.9,.28,1.2), ease-in-out;
  animation-iteration-count: 1, infinite;
  animation-fill-mode: both, none;
}
.collage-back { z-index: 5; }
.collage-front { z-index: 20; }

/* ── Hero chart pop-in ── */
@keyframes hero-pop {
  0% { opacity: 0; transform: scale(0.9) translateY(20px) rotate(var(--r, 0deg)); }
  60% { opacity: 1; transform: scale(1.02) translateY(-3px) rotate(var(--r, 0deg)); }
  100% { opacity: 1; transform: scale(1) translateY(0) rotate(var(--r, 0deg)); }
}
.hero-pop {
  opacity: 0; z-index: 15;
  animation: hero-pop 0.8s cubic-bezier(.22,.9,.28,1.15) forwards;
  animation-delay: 0.1s;
}

/* ── Scroll-reveal pop variant ── */
.reveal-pop { opacity: 0; transform: scale(0.94) translateY(10px); transition: opacity 0.6s cubic-bezier(.22,.9,.28,1.1), transform 0.6s cubic-bezier(.22,.9,.28,1.1); }
.reveal-pop.is-visible { opacity: 1; transform: scale(1) translateY(0); }

/* ── Bento showcase cards ── */
.bento {
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
}
.bento:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 40px -16px rgba(11, 18, 15, 0.16);
  border-color: var(--line-strong);
}
.bento-media {
  overflow: hidden;
  background: var(--tint);
  border-bottom: 1px solid var(--line);
}
.bento-media img { transition: transform 0.5s cubic-bezier(.2,.8,.2,1); display: block; width: 100%; }
.bento:hover .bento-media img { transform: scale(1.035); }
.bento-arrow {
  position: absolute; top: 1.1rem; right: 1.1rem; width: 2rem; height: 2rem;
  border-radius: 999px; background: var(--tint); display: flex; align-items: center; justify-content: center;
  color: var(--ink); transition: background-color 0.2s ease, transform 0.2s ease;
}
.bento:hover .bento-arrow { background: var(--brand); color: #fff; transform: translate(2px, -2px); }

.bento-dark { background-color: var(--ink); color: #fff; border-color: var(--ink); }
.bento-dark .bento-media { background: #121A16; border-bottom-color: #223029; }

/* ── Pill icon ── */
.pill-icon { width: 2.5rem; height: 2.5rem; border-radius: 0.7rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ── Grade badges ── */
.grade-badge {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 0.75rem;
  width: 1.9rem; height: 1.9rem; border-radius: 0.5rem;
}
.grade-a { background-color: #DCF6E4; color: #0A7A3D; border: 1px solid #B4E9C4; }

/* ── Cards ── */
.card-clean { background-color: var(--surface); border: 1px solid var(--line); border-radius: 1rem; }

/* ── FAQ ── */
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details[open] summary .faq-chevron { transform: rotate(180deg); }
.faq-chevron { transition: transform 0.2s ease; }
details[open] { border-color: var(--line-strong); background: var(--tint); }

/* ── Reveal on scroll (staggered) ── */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.7s cubic-bezier(.2,.7,.2,1), transform 0.7s cubic-bezier(.2,.7,.2,1); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-d1.is-visible { transition-delay: 0.08s; }
.reveal-d2.is-visible { transition-delay: 0.16s; }
.reveal-d3.is-visible { transition-delay: 0.24s; }
.reveal-d4.is-visible { transition-delay: 0.32s; }

/* ── Logo on dark ── */
.logo-on-dark { filter: brightness(0) invert(1); }

/* ── Number strip ── */
.num-strip-item { border-left: 1px solid var(--line); }
.num-strip-item:first-child { border-left: none; }
.stat-num { font-weight: 800; letter-spacing: -0.02em; }

/* ── Methodology dark cards ── */
.method-card { background-color: #10201A; border: 1px solid #1E362C; border-radius: 1rem; transition: transform 0.2s ease, border-color 0.2s ease; }
.method-card:hover { transform: translateY(-3px); border-color: #2C4A3C; }

/* ── Underline accent for headline words ── */
.underline-brand { text-decoration: underline; text-decoration-color: var(--brand-mid); text-decoration-thickness: 3px; text-underline-offset: 6px; }

@media (max-width: 640px) {
  .collage-card { display: none; }
}

/* ── Reduced motion: no marquee, float, entrance or scroll-reveal animation ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .animate-marquee,
  .animate-float,
  .animate-spin,
  .ticker-track,
  .app-ticker-track { animation: none !important; }
  .animate-fade-up,
  .animate-fade-in,
  .animate-drop-in,
  .fade-up,
  .fade-in-el,
  .swap-in,
  .hero-pop { animation: none !important; opacity: 1 !important; transform: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* Ticker pause control */
/* "Pause all animations" (toggled by the button in the ticker strip) */
.animations-paused .animate-marquee,
.animations-paused .animate-float,
.animations-paused .ticker-track,
.animations-paused .app-ticker-track { animation-play-state: paused !important; }
.animations-paused .animate-fade-up,
.animations-paused .animate-fade-in,
.animations-paused .animate-drop-in,
.animations-paused .fade-up,
.animations-paused .fade-in-el,
.animations-paused .hero-pop { animation: none !important; opacity: 1 !important; transform: none !important; }
.animations-paused .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
.animations-paused, .animations-paused * { scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) {
  .ticker-toggle { display: none !important; }
}

/* Platform menu: Escape dismisses it even while the trigger keeps focus */
#platform-menu.is-dismissed #platform-menu-panel { opacity: 0 !important; visibility: hidden !important; }
