/* ============================================================
   Bloom landing — ported 1:1 from the Next app (app/page.tsx +
   app/globals.css). Class names and values kept identical; the
   React `narrow` boolean becomes the ≤879px media queries below.
   ============================================================ */

:root {
  --v2-out: cubic-bezier(0.23, 1, 0.32, 1);
  --v2-inout: cubic-bezier(0.77, 0, 0.175, 1);
}

/* ---------- shared component classes (from globals.css) ---------- */
.bl-cta {
  border: none;
  background: var(--clay-600);
  color: var(--on-clay);
  font-family: var(--font-ui);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--dur) var(--ease), transform var(--dur-fast) var(--ease),
    box-shadow var(--dur) var(--ease);
}
.bl-cta:hover { background: var(--clay-700); color: var(--on-clay); transform: translateY(-1px); box-shadow: var(--e2); }
.bl-cta:active { transform: translateY(0) scale(0.985); box-shadow: var(--e1); transition-duration: var(--dur-fast); }
.bl-cta-growth:hover { background: var(--clay-500); transform: translateY(-1px); }
.bl-cta-growth:active { transform: translateY(0) scale(0.985); }

.bl-btn-secondary {
  background: var(--paper-1);
  color: var(--ink-900);
  border: 1px solid var(--line-300);
  font-family: var(--font-ui);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
    transform var(--dur-fast) var(--ease);
}
.bl-btn-secondary:hover { background: var(--paper-2); border-color: var(--ink-500); }
.bl-btn-secondary:active { transform: scale(0.98); }

.bl-automate {
  border: 1px solid var(--clay-600);
  background: var(--paper-1);
  color: var(--clay-600);
  font-family: var(--font-ui);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.bl-automate:hover { background: var(--clay-600); color: var(--on-clay); }

.bl-mktlink { transition: color var(--dur) var(--ease); text-decoration: none; }
.bl-mktlink:hover { color: var(--ink-900) !important; }
.bl-arrow-link svg { transition: transform var(--dur) var(--ease); }
.bl-arrow-link:hover svg { transform: translateX(3px); }

.bl-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
  will-change: opacity, transform;
}
.bl-reveal.is-in { opacity: 1; transform: none; }

@keyframes blFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.bl-float { animation: blFloat 4.5s var(--ease) infinite; }

/* ---------- v2 story classes (from globals.css, verbatim) ---------- */
.v2-copy {
  opacity: 0;
  transform: translateY(16px);
  filter: blur(3px);
  transition: opacity 0.44s var(--v2-out), transform 0.44s var(--v2-out), filter 0.44s var(--v2-out);
  pointer-events: none;
}
.v2-copy.is-on { opacity: 1; transform: none; filter: none; pointer-events: auto; transition-delay: 0.05s; }

.v2-rail { position: relative; width: 2px; background: var(--line-200); border-radius: 999px; }
.v2-rail__fill { position: absolute; inset: 0; background: var(--clay-600); border-radius: 999px; transform-origin: top; transform: scaleY(0); }
.v2-rail__stop { position: absolute; left: 50%; width: 22px; height: 22px; border: 0; padding: 0; background: transparent; cursor: pointer; display: grid; place-items: center; }
.v2-rail__stop i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-300); border: 1.5px solid var(--paper-0); transition: transform 0.24s var(--v2-out), background 0.24s var(--v2-out), box-shadow 0.24s var(--v2-out); }
.v2-rail__stop:hover i { transform: scale(1.35); background: var(--clay-500); }
.v2-rail__stop.is-active i { background: var(--clay-600); transform: scale(1.4); box-shadow: 0 0 0 4px var(--clay-soft); }
.v2-rail__tag { position: absolute; left: 22px; top: 50%; transform: translateY(-50%) translateX(-4px); white-space: nowrap; font-family: var(--font-ui); font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-500); opacity: 0; transition: opacity 0.24s var(--v2-out), transform 0.24s var(--v2-out), color 0.24s var(--v2-out); pointer-events: none; }
.v2-rail__stop:hover .v2-rail__tag { opacity: 1; transform: translateY(-50%) translateX(0); color: var(--clay-600); }

.v2-cmt { opacity: 0; transform: translateY(16px); transition: opacity 0.32s var(--v2-out), transform 0.32s var(--v2-out); }
.v2-cmt.is-in { opacity: 1; transform: none; }
.v2-hit { border-radius: 12px; transition: background 0.45s var(--v2-out), box-shadow 0.45s var(--v2-out); }
.v2-hit.is-live { background: rgba(206, 90, 63, 0.16); box-shadow: inset 0 0 0 1px rgba(206, 90, 63, 0.6); }

.v2-typing { opacity: 0; transform: translateY(8px); transition: opacity 0.26s var(--v2-out), transform 0.26s var(--v2-out); }
.v2-typing.is-in { opacity: 1; transform: none; }
@keyframes v2Dot {
  0%, 60%, 100% { opacity: 0.35; transform: none; }
  30% { opacity: 1; transform: translateY(-2px); }
}
.v2-typing i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #8e8e8e; animation: v2Dot 1.15s var(--ease) infinite; }
.v2-typing i:nth-child(2) { animation-delay: 0.14s; }
.v2-typing i:nth-child(3) { animation-delay: 0.28s; }

.v2-pop { opacity: 0; transform: translateY(12px) scale(0.96); filter: blur(2px); transform-origin: 18% 100%; transition: opacity 0.36s var(--v2-out), transform 0.36s var(--v2-out), filter 0.36s var(--v2-out); }
.v2-pop.is-in { opacity: 1; transform: none; filter: none; }

.v2-tapbtn { transition: transform 0.13s var(--v2-out), background 0.13s var(--v2-out), box-shadow 0.3s var(--v2-out); }
.v2-tapbtn.is-tapped { transform: scale(0.955); background: #4b4b4f; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.16); }

.v2-chip { opacity: 0; transform: translateY(12px) scale(0.97); transition: opacity 0.4s var(--v2-out), transform 0.4s var(--v2-out); }
.v2-chip.is-in { opacity: 1; transform: none; }

.v2-acc { border-bottom: 1px solid var(--line-200); }
.v2-acc__q { width: 100%; background: transparent; border: 0; display: flex; align-items: center; gap: 18px; padding: 19px 2px; cursor: pointer; text-align: left; }
.v2-acc__q:hover .v2-acc__t { color: var(--clay-600); }
.v2-acc__t { transition: color var(--dur) var(--ease); }
.v2-acc__x { flex: none; transition: transform 0.26s var(--v2-out), color 0.26s var(--v2-out); }
.v2-acc.is-open .v2-acc__x { transform: rotate(45deg); color: var(--clay-600); }
.v2-acc__body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.3s var(--v2-out); }
.v2-acc.is-open .v2-acc__body { grid-template-rows: 1fr; }
.v2-acc__inner { overflow: hidden; min-height: 0; }

/* ---------- layout atoms (the React inline atoms as classes) ---------- */
.ld-container { max-width: 1160px; margin: 0 auto; padding: 0 24px; width: 100%; }
.ld-label { font-family: var(--font-ui); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.ld-h2 { font-family: var(--font-display); font-weight: 500; font-size: clamp(28px, 4vw, 40px); line-height: 1.12; letter-spacing: -.015em; color: var(--ink-900); margin: 0; }
.ld-body { font-family: var(--font-body); font-size: 16.5px; line-height: 1.6; color: var(--ink-700); }
.ld-reassure { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-ui); font-size: 12.5px; color: var(--ink-500); }
.ld-reassure.on-dark { color: var(--on-dark-700); }

/* ---------- landing header (fixed; blur on scroll) ---------- */
.ld-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: transparent; border-bottom: 1px solid transparent;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.ld-header.is-scrolled {
  background: rgba(241, 234, 220, .88);
  -webkit-backdrop-filter: saturate(1.1) blur(10px);
  backdrop-filter: saturate(1.1) blur(10px);
  border-bottom-color: var(--line-200);
}
.ld-header__in { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.ld-header nav { display: flex; align-items: center; gap: 28px; }

/* ---------- story stage ---------- */
.ld-story { position: relative; height: 808vh; }
.ld-stage { position: sticky; top: 0; height: 100svh; overflow: hidden; display: flex; align-items: center; }
.ld-stage__in { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 24px; height: 100%; }
.ld-bar { position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--clay-600); transform-origin: 0 50%; transform: scaleX(0); z-index: 5; display: none; }
.ld-copy-col { flex: 1; min-width: 0; max-width: 470px; position: relative; align-self: center; }
.ld-phone-col { flex: none; position: relative; display: flex; justify-content: center; width: 380px; }
.ld-h1 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: clamp(38px, 4.6vw, 56px); line-height: 1.06; letter-spacing: -.02em; color: var(--ink-900); }
.ld-hero-sub { font-size: 18.5px; margin: 18px 0 0; max-width: 38ch; }
.ld-hero-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 13px; margin: 30px 0 0; }
.ld-cta-lg { display: inline-flex; align-items: center; gap: 8px; padding: 14px 26px; border-radius: var(--radius-md); font-size: 15px; }
.ld-btn2-lg { display: inline-flex; align-items: center; gap: 8px; padding: 13px 22px; border-radius: var(--radius-md); font-size: 15px; color: var(--ink-900); }
.ld-beat-title { font-family: var(--font-display); font-weight: 500; font-size: clamp(28px, 3.2vw, 38px); line-height: 1.12; letter-spacing: -.015em; color: var(--ink-900); margin: 12px 0 0; }
.ld-beat-body { font-family: var(--font-body); font-size: 16.5px; line-height: 1.6; color: var(--ink-700); margin: 14px 0 0; max-width: 36ch; }
.ld-rail-wrap { align-self: center; height: min(300px, 46vh); flex: none; margin-right: 34px; }

/* ---------- bento grid ---------- */
.ld-bento { display: grid; grid-template-columns: 1.15fr 1fr 1fr; grid-auto-rows: minmax(200px, auto); gap: 1px; background: var(--line-200); border: 1px solid var(--line-200); border-radius: var(--radius-lg); overflow: hidden; }
.ld-bento .cell-1 { grid-row: 1 / span 2; }

/* ---------- pricing grid ---------- */
.ld-pricing { max-width: 880px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1.12fr; border-radius: var(--radius-2xl); overflow: hidden; border: 1px solid var(--line-200); box-shadow: var(--e2); }

/* ---------- reduced-motion swap: scrub story vs static telling ---------- */
.ld-story-static { display: none; }
@media (prefers-reduced-motion: reduce) {
  .ld-story { display: none; }
  .ld-story-static { display: block; padding-top: 64px; }
  .v2-copy, .v2-cmt, .v2-pop, .v2-chip { opacity: 1 !important; transform: none !important; filter: none !important; }
  .v2-typing { display: none !important; }
  .v2-typing i { animation: none !important; }
  .bl-reveal { opacity: 1 !important; transform: none !important; }
  .bl-float { animation: none !important; }
}

/* ---------- narrow (<880px) — the React `narrow` branch ---------- */
@media (max-width: 879px) {
  .ld-header nav { display: none; }
  .ld-header .ld-login { display: none; }
  .ld-stage__in { flex-direction: column-reverse; justify-content: flex-start; gap: 10px; padding-bottom: max(18px, env(safe-area-inset-bottom)); padding-top: 74px; }
  .ld-bar { display: block; }
  .ld-rail-wrap { display: none; }
  .ld-copy-col { max-width: none; align-self: stretch; min-height: 236px; }
  .ld-h1 { font-size: clamp(30px, 8.6vw, 38px); }
  .ld-hero-sub { font-size: 15.5px; }
  .ld-hero-ctas { margin: 20px 0 0; }
  .ld-cta-lg { padding: 12px 20px; font-size: 14px; }
  .ld-btn2-lg { padding: 11px 18px; font-size: 14px; }
  .ld-beat-title { font-size: clamp(24px, 6.4vw, 30px); }
  .ld-beat-body { font-size: 14.5px; }
  .ld-phone-col { width: auto; }
  .ld-reassure-row { display: none; }
  .ld-bento { grid-template-columns: 1fr; }
  .ld-bento .cell-1 { grid-row: auto; }
  .ld-pricing { grid-template-columns: 1fr; }
}
