/* Landing (meritapp.work): the public front page. Uses the theme's tokens, with fallbacks so the page holds
   together on its own. Everything here is scoped to .lp-* classes; buttons and icons come from the theme.
   Layout: a glass header, a two-column hero (copy + an animated "live trading" card) from 1024 px, then
   how it works, the rules, proof before money, safety and a closing call to action. */

.lp,
.lp-header {
  --lp-bg: var(--bg, #f9fafd);
  --lp-surface: var(--surface, #ffffff);
  --lp-surface-2: var(--surface-2, #f2f3f8);
  --lp-border: var(--border, rgba(18, 20, 38, 0.09));
  --lp-border-strong: var(--border-strong, rgba(18, 20, 38, 0.16));
  --lp-text: var(--text, #11121a);
  --lp-text-2: var(--text-2, #474b5c);
  --lp-text-3: var(--text-3, #7a7e90);
  --lp-accent: var(--accent, oklch(0.56 0.21 280));
  --lp-accent-2: oklch(0.64 0.2 315);
  --lp-accent-soft: var(--accent-soft, oklch(0.56 0.21 280 / 0.12));
  --lp-on-accent: var(--on-accent, #ffffff);
  --lp-profit: var(--profit, oklch(0.63 0.15 155));
  --lp-paper: var(--paper, oklch(0.76 0.15 75));
  --lp-font: var(--font, "Outfit", system-ui, sans-serif);
  --lp-mono: var(--font-mono, "JetBrains Mono", ui-monospace, monospace);
  --lp-ease: var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1));
  --lp-gutter: clamp(16px, 4vw, 40px);
  --lp-shadow: 0 1px 2px rgba(16, 18, 40, 0.05), 0 12px 32px -12px rgba(16, 18, 40, 0.18),
    0 40px 80px -40px rgba(60, 40, 160, 0.28);
}

html[data-theme="dark"] .lp,
html[data-theme="dark"] .lp-header {
  --lp-bg: var(--bg, #0c0d13);
  --lp-surface: var(--surface, #14151d);
  --lp-surface-2: var(--surface-2, #191b25);
  --lp-border: var(--border, rgba(255, 255, 255, 0.08));
  --lp-border-strong: var(--border-strong, rgba(255, 255, 255, 0.15));
  --lp-text: var(--text, #eef0f7);
  --lp-text-2: var(--text-2, #b4b8c8);
  --lp-text-3: var(--text-3, #80859a);
  --lp-accent: var(--accent, oklch(0.7 0.17 282));
  --lp-accent-2: oklch(0.74 0.16 318);
  --lp-accent-soft: var(--accent-soft, oklch(0.7 0.17 282 / 0.16));
  --lp-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -16px rgba(0, 0, 0, 0.6),
    0 40px 90px -40px rgba(90, 70, 220, 0.35);
}

/* The landing has no app shell: main runs edge to edge. */
main.app-main:has(> .lp) {
  padding: 0;
  margin: 0;
  max-width: none;
  display: block;
}

.lp {
  font-family: var(--lp-font);
  color: var(--lp-text);
  overflow-x: clip;
  padding-inline: 0; /* full bleed: the theme gives layouts placed in main a side gutter */
}

.lp-wrap {
  width: min(1200px, 100% - 2 * var(--lp-gutter));
  margin-inline: auto;
}

/* Icons size with the text here, whatever order the stylesheets load in. */
.lp .icon,
.lp-header .icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.18em;
}

/* --- header ------------------------------------------------------------------------------------ */

.lp-header {
  position: sticky;
  top: 0;
  z-index: 40;
  font-family: var(--lp-font);
  background: color-mix(in oklab, var(--lp-bg) 70%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  backdrop-filter: blur(16px) saturate(1.5);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.lp-header.is-stuck {
  border-bottom-color: var(--lp-border);
  background: color-mix(in oklab, var(--lp-bg) 84%, transparent);
}

.lp-header-row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
}

.lp-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--lp-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.12rem;
  letter-spacing: -0.01em;
}

.lp-brand-tile {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--lp-on-accent);
  background: linear-gradient(135deg, var(--lp-accent), var(--lp-accent-2));
  box-shadow: 0 6px 16px -6px var(--lp-accent);
}

.lp-brand-tile .icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lp-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* --- hero ---------------------------------------------------------------------------------------- */

.lp-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: clamp(40px, 8vw, 112px) clamp(56px, 9vw, 128px);
}

.lp-glow {
  position: absolute;
  inset: -20% -10% auto;
  height: 120%;
  z-index: -2;
  background:
    radial-gradient(40% 45% at 72% 30%, color-mix(in oklab, var(--lp-accent) 26%, transparent), transparent 70%),
    radial-gradient(32% 38% at 92% 70%, color-mix(in oklab, var(--lp-accent-2) 22%, transparent), transparent 70%),
    radial-gradient(30% 34% at 12% 10%, color-mix(in oklab, var(--lp-profit) 14%, transparent), transparent 70%);
  filter: blur(8px);
}

.lp-dots {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(color-mix(in oklab, var(--lp-text) 14%, transparent) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(70% 60% at 60% 35%, #000 20%, transparent 75%);
  mask-image: radial-gradient(70% 60% at 60% 35%, #000 20%, transparent 75%);
  opacity: 0.5;
}

.lp-hero-grid {
  display: grid;
  gap: clamp(40px, 6vw, 72px);
  align-items: center;
}

@media (min-width: 1024px) {
  .lp-hero-grid { grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr); }
}

.lp-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  padding: 7px 14px 7px 12px;
  border: 1px solid var(--lp-border);
  border-radius: 999px;
  background: color-mix(in oklab, var(--lp-surface) 70%, transparent);
  color: var(--lp-text-2);
  font-size: 0.86rem;
  letter-spacing: 0.01em;
}

.lp-pulse {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lp-profit);
}

.lp-pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--lp-profit);
  opacity: 0;
  animation: lp-ping 2.4s var(--lp-ease) infinite;
}

.lp-title {
  margin: 0;
  font-size: clamp(2.55rem, 1.45rem + 4.9vw, 5.25rem);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.lp-accent {
  font-weight: 400;
  background: linear-gradient(100deg, var(--lp-accent) 10%, var(--lp-accent-2) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lp-lead {
  max-width: 36rem;
  margin: 24px 0 0;
  color: var(--lp-text-2);
  font-size: clamp(1.05rem, 0.98rem + 0.4vw, 1.24rem);
  font-weight: 300;
  line-height: 1.65;
}

.lp-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.lp-ticks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  color: var(--lp-text-2);
  font-size: 0.93rem;
}

.lp-ticks li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lp-ticks .icon,
.lp-tile-icon .icon,
.lp-float-icon .icon,
.lp-card-meta .icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.lp-ticks .icon { color: var(--lp-profit); }

/* --- hero visual: the "live trading" card ---------------------------------------------------- */

.lp-hero-visual {
  position: relative;
  max-width: 520px;
  width: 100%;
  margin-inline: auto;
  padding: 28px 0 40px;
}

.lp-card {
  position: relative;
  border: 1px solid var(--lp-border);
  border-radius: 24px;
  background: color-mix(in oklab, var(--lp-surface) 88%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: var(--lp-shadow);
}

.lp-card-main {
  padding: 20px 20px 18px;
  animation: lp-rise 0.9s var(--lp-ease) both;
}

@media (min-width: 1024px) {
  .lp-card-main {
    transform: perspective(1400px) rotateY(-7deg) rotateX(3deg);
    transition: transform 0.6s var(--lp-ease);
    animation-name: lp-rise-tilt;
  }
  .lp-hero-visual:hover .lp-card-main { transform: perspective(1400px) rotateY(-2deg) rotateX(1deg); }
}

.lp-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lp-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
}

.lp-chip-paper {
  color: color-mix(in oklab, var(--lp-paper) 70%, var(--lp-text));
  background: color-mix(in oklab, var(--lp-paper) 16%, transparent);
}

.lp-chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lp-paper);
}

.lp-card-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--lp-text-3);
  font-size: 0.8rem;
}

.lp-card-meta .icon { width: 15px; height: 15px; }

.lp-kpis {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}

.lp-kpi {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.lp-kpi-label,
.lp-mini span {
  color: var(--lp-text-3);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lp-kpi-value {
  font-family: var(--lp-mono);
  font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.3rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.lp-kpi-foot {
  color: var(--lp-text-2);
  font-size: 0.84rem;
}

.lp-pos { color: var(--lp-profit); }

.lp-ring {
  position: relative;
  flex: none;
  width: 84px;
  height: 84px;
}

.lp-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.lp-ring circle {
  fill: none;
  stroke-width: 4.5;
  stroke-linecap: round;
}

.lp-ring-track { stroke: var(--lp-border); }

.lp-ring-value {
  stroke: var(--lp-profit);
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: lp-ring 1.6s 0.5s var(--lp-ease) forwards;
}

.lp-ring-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  font-family: var(--lp-mono);
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.1;
}

.lp-ring-label small {
  font-family: var(--lp-font);
  color: var(--lp-text-3);
  font-size: 0.62rem;
  font-weight: 400;
}

.lp-chart {
  display: block;
  width: 100%;
  height: 128px;
  margin-top: 14px;
  color: var(--lp-accent);
  overflow: visible;
}

.lp-chart-grid line {
  stroke: var(--lp-border);
  stroke-dasharray: 3 5;
}

.lp-chart-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: lp-draw 2.2s 0.35s var(--lp-ease) forwards;
}

.lp-chart-area {
  opacity: 0;
  animation: lp-fade 1.2s 1.2s ease forwards;
}

.lp-buy,
.lp-sell {
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  animation: lp-pop 0.5s var(--t, 1s) var(--lp-ease) forwards;
  vector-effect: non-scaling-stroke;
}

.lp-buy {
  fill: var(--lp-surface);
  stroke: var(--lp-accent);
  stroke-width: 2;
}

.lp-sell { fill: var(--lp-profit); }

.lp-mini {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--lp-border);
}

.lp-mini div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.lp-mini strong {
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lp-float {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 10px 10px;
  border: 1px solid var(--lp-border);
  border-radius: 16px;
  background: color-mix(in oklab, var(--lp-surface) 92%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: var(--lp-shadow);
  font-size: 0.84rem;
  white-space: nowrap;
  opacity: 0;
  animation: lp-float-in 0.8s var(--d, 1s) var(--lp-ease) forwards, lp-bob 7s calc(var(--d, 1s) + 0.8s) ease-in-out infinite;
}

.lp-float div {
  display: grid;
  gap: 1px;
}

.lp-float strong { font-weight: 500; }

.lp-float span:not(.lp-float-icon) {
  color: var(--lp-text-3);
  font-size: 0.78rem;
}

.lp-float span.lp-pos { color: var(--lp-profit); }

.lp-float-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
}

.lp-icon-buy { color: var(--lp-accent); background: var(--lp-accent-soft); }
.lp-icon-sell { color: var(--lp-profit); background: color-mix(in oklab, var(--lp-profit) 14%, transparent); }
.lp-icon-safe { color: var(--lp-paper); background: color-mix(in oklab, var(--lp-paper) 16%, transparent); }

.lp-float-a { --d: 1.4s; top: 0; left: -12%; }
.lp-float-b { --d: 2.3s; top: 50%; right: -8%; }
.lp-float-c { --d: 3.1s; bottom: 0; left: 6%; }

/* The card starts below the first bubble, so the bubble never covers the card's header. */
@media (min-width: 561px) {
  .lp-hero-visual { padding-top: 76px; }
}

@media (max-width: 1023px) {
  .lp-float-a { left: 0; }
  .lp-float-b { right: -2%; }
}

@media (max-width: 560px) {
  .lp-hero-visual { padding-bottom: 12px; }
  .lp-float { position: static; margin-top: 10px; width: fit-content; max-width: 100%; animation-name: lp-float-in; }
  .lp-float-a, .lp-float-c { display: none; }
  .lp-float-b { margin-left: auto; }
  .lp-kpis { align-items: flex-start; }
  .lp-ring { width: 72px; height: 72px; }
}

/* --- sections -------------------------------------------------------------------------------------- */

.lp-section {
  padding-block: clamp(64px, 10vw, 128px);
  scroll-margin-top: 64px;
}

.lp-band {
  padding-block: clamp(48px, 7vw, 88px);
  background: linear-gradient(180deg, color-mix(in oklab, var(--lp-surface-2) 70%, transparent), transparent 85%);
  border-top: 1px solid var(--lp-border);
}

/* principles */

.lp-tile {
  position: relative;
  overflow: hidden;
  padding: clamp(22px, 3vw, 30px);
  border: 1px solid var(--lp-border);
  border-radius: 20px;
  background: var(--lp-surface);
  transition: translate 0.35s var(--lp-ease), box-shadow 0.35s var(--lp-ease), border-color 0.35s ease;
}

.lp-tile::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, var(--lp-accent), var(--lp-accent-2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--lp-ease);
}

.lp-tile:hover {
  translate: 0 -4px;
  border-color: var(--lp-border-strong);
  box-shadow: var(--lp-shadow);
}

.lp-tile:hover::before { transform: scaleX(1); }

.lp-tile-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 18px;
  border-radius: 14px;
  color: var(--lp-accent);
  background: var(--lp-accent-soft);
}

.lp-tile-icon .icon { width: 21px; height: 21px; }

.lp-tile h3 {
  margin: 0 0 8px;
  font-size: 1.14rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.lp-tile p {
  margin: 0;
  color: var(--lp-text-2);
  font-size: 0.97rem;
  font-weight: 300;
  line-height: 1.6;
}

.lp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 16px;
}

.lp-grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

/* footer */

.lp-footer {
  margin-top: clamp(48px, 8vw, 96px);
  padding-block: 28px;
  border-top: 1px solid var(--lp-border);
}

.lp-footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lp-brand-sm { font-size: 1rem; }
.lp-brand-sm .lp-brand-tile { width: 28px; height: 28px; border-radius: 9px; }
.lp-brand-sm .lp-brand-tile .icon { width: 17px; height: 17px; }

.lp-footer-note {
  margin: 0;
  color: var(--lp-text-3);
  font-size: 0.88rem;
}

/* --- reveal on scroll (landing script adds .is-in; content stays visible without JavaScript) ------ */

.js .lp [data-reveal]:not(.is-in) {
  opacity: 0;
  transform: translateY(16px);
}

.js .lp [data-reveal] {
  transition: opacity 0.8s var(--lp-ease), transform 0.8s var(--lp-ease), translate 0.35s var(--lp-ease),
    box-shadow 0.35s var(--lp-ease), border-color 0.35s ease;
  transition-delay: calc(var(--i, 0) * 70ms), calc(var(--i, 0) * 70ms), 0s, 0s, 0s;
}

/* --- keyframes ------------------------------------------------------------------------------------ */

@keyframes lp-ping {
  0% { transform: scale(0.6); opacity: 0.7; }
  80%, 100% { transform: scale(1.8); opacity: 0; }
}

@keyframes lp-draw { to { stroke-dashoffset: 0; } }
@keyframes lp-fade { to { opacity: 1; } }
@keyframes lp-ring { to { stroke-dashoffset: 16; } }

@keyframes lp-pop {
  0% { opacity: 0; transform: scale(0.2); }
  70% { opacity: 1; transform: scale(1.25); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes lp-rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

@keyframes lp-rise-tilt {
  from { opacity: 0; transform: perspective(1400px) rotateY(-7deg) rotateX(3deg) translateY(28px); }
  to { opacity: 1; transform: perspective(1400px) rotateY(-7deg) rotateX(3deg); }
}

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

@keyframes lp-bob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -8px; }
}

@media (prefers-reduced-motion: reduce) {
  .lp *,
  .lp *::before,
  .lp *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  .lp-chart-line { stroke-dashoffset: 0; }
  .lp-ring-value { stroke-dashoffset: 16; }
  .js .lp [data-reveal]:not(.is-in) { opacity: 1; transform: none; }
}
