/* ==========================================================================
   Cinematic layer for the marketing site (homepage, topic pages, pricing,
   coming soon). Loaded after site.css / topic.css. Works with motion.js.
   - Dark, glowing hero with drifting light and a floating phone
   - Word-by-word headline entrance and scroll-triggered reveals
   - Hand-drawn underline accents
   - Floating pill shapes for cards, buttons and labels
   ========================================================================== */

:root {
  --ease-cine: cubic-bezier(0.16, 1, 0.3, 1);
  --float-shadow: 0 1px 2px rgba(15, 43, 87, 0.04), 0 22px 48px -30px rgba(15, 43, 87, 0.38);
  --float-shadow-hover: 0 2px 6px rgba(15, 43, 87, 0.06), 0 34px 64px -30px rgba(15, 43, 87, 0.5);
  --pill-r: 32px;
}

/* ---------- Entrance and scroll motion (only when motion.js is active) ---------- */

html.motion [data-intro] {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(8px);
  transition: opacity 1s var(--ease-cine), transform 1.2s var(--ease-cine), filter 1s ease;
  transition-delay: var(--d, 0ms);
}
html.motion.is-ready [data-intro] { opacity: 1; transform: none; filter: none; }

h1[data-split] .w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 0.02em 0.14em; margin-bottom: -0.14em; }
h1[data-split] .w.has-accent { overflow: visible; }
h1[data-split] .wi {
  display: inline-block;
  transform: translateY(105%) rotate(3deg);
  transform-origin: left bottom;
  opacity: 0;
  filter: blur(12px);
  transition: transform 1.2s var(--ease-cine), opacity 0.9s ease, filter 1s ease;
  transition-delay: calc(var(--i) * 90ms + 150ms);
}
html.is-ready h1[data-split] .wi { transform: none; opacity: 1; filter: none; }

html.motion .reveal {
  opacity: 0;
  transform: translateY(44px) scale(0.97);
  filter: blur(6px);
  transition: opacity 1s var(--ease-cine), transform 1.2s var(--ease-cine), filter 1s ease, translate 0.5s var(--ease-cine), box-shadow 0.5s var(--ease-cine), border-color 0.4s ease, background-color 0.4s ease;
  transition-delay: var(--d, 0ms), var(--d, 0ms), var(--d, 0ms), 0ms, 0ms, 0ms, 0ms;
}
html.motion .reveal.is-in { opacity: 1; transform: none; filter: none; }

/* ---------- Hand-drawn underline accents ---------- */

.accent { position: relative; display: inline-block; white-space: nowrap; }
.accent-line { position: absolute; left: -3%; bottom: -0.2em; width: 106%; height: 0.38em; overflow: visible; pointer-events: none; }
.accent-line path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.3s cubic-bezier(0.65, 0, 0.35, 1); }
.accent-line path + path { transition-delay: 0.35s; }
.accent.is-drawn .accent-line path { stroke-dashoffset: 0; }
.text-grad.accent { padding-bottom: 0.04em; }
.cta-panel .accent-line path { stroke: rgba(255, 255, 255, 0.92); }

/* ---------- Header over the dark hero ---------- */

.site-header { transition: background-color 0.45s ease, border-color 0.45s ease, backdrop-filter 0.45s ease; }
.site-header.is-over-hero { background: transparent; border-bottom-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.site-header.is-over-hero .lw-text { color: #fff; }
.site-header.is-over-hero .nav-trigger,
.site-header.is-over-hero .nav-link { color: rgba(255, 255, 255, 0.84); }
.site-header.is-over-hero .nav-trigger:hover,
.site-header.is-over-hero .nav-link:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.site-header.is-over-hero .nav-chev { color: rgba(255, 255, 255, 0.55); }
.site-header.is-over-hero .btn-ghost { color: #fff; }
.site-header.is-over-hero .btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }
.site-header.is-over-hero .nav-toggle { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.22); color: #fff; }

/* ---------- Cinematic dark hero ---------- */

.hero.hero-dark {
  margin-top: calc(-1 * var(--header-h) - 1px);
  padding: calc(var(--header-h) + 92px) 0 0;
  background:
    radial-gradient(1200px 600px at 50% 120%, rgba(14, 154, 160, 0.18), transparent 60%),
    linear-gradient(180deg, #050F24 0%, #0A1F42 55%, #0B2A52 100%);
  color: #fff;
}
.hero-dark::before {
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 0%, transparent 70%);
  mask-image: radial-gradient(ellipse at 50% 30%, #000 0%, transparent 70%);
}
.hero-aurora { position: absolute; inset: -10% -10% 0; pointer-events: none; filter: blur(70px); }
.hero-aurora span { position: absolute; border-radius: 50%; animation: drift 20s ease-in-out infinite alternate; }
.hero-aurora span:nth-child(1) { width: 640px; height: 640px; left: 52%; top: -6%; background: radial-gradient(circle, rgba(20, 167, 168, 0.55), transparent 65%); }
.hero-aurora span:nth-child(2) { width: 600px; height: 600px; left: -12%; top: 18%; background: radial-gradient(circle, rgba(29, 78, 216, 0.5), transparent 65%); animation-duration: 24s; animation-direction: alternate-reverse; }
.hero-aurora span:nth-child(3) { width: 460px; height: 460px; left: 34%; top: 50%; background: radial-gradient(circle, rgba(110, 76, 220, 0.32), transparent 65%); animation-duration: 28s; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, -40px) scale(1.1); }
  100% { transform: translate(-40px, 30px) scale(0.94); }
}
.hero-dark > .container { position: relative; z-index: 1; }
.hero-dark h1 { color: #fff; font-size: clamp(2.6rem, 5.4vw, 4.4rem); letter-spacing: -0.04em; }
.hero-dark .text-grad { background: linear-gradient(110deg, #7FE3DF 0%, #6FB1FF 55%, #B8C9FF 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-dark .hero-lede { color: #B9C4D6; }
.hero-dark .link-arrow { color: #7FE3DF; }
.hero-dark .hero-points li { color: #E3E9F3; }
.hero-dark .check-dot { background: rgba(95, 214, 210, 0.16); color: #7FE3DF; }

.hero-dark .hero-visual {
  background: none;
  box-shadow: none;
  padding: 24px 0 48px;
  translate: 0 var(--py, 0);
}
.phone-glow {
  position: absolute;
  z-index: -1;
  left: 50%; top: 50%;
  width: 520px; height: 520px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 196, 191, 0.45) 0%, rgba(79, 125, 240, 0.28) 40%, transparent 70%);
  filter: blur(24px);
  animation: glow 7s ease-in-out infinite;
}
@keyframes glow { 0%, 100% { opacity: 0.85; transform: translate(-50%, -50%) scale(1); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); } }
.hero-dark .phone {
  animation: floaty 8s ease-in-out infinite;
  box-shadow: 0 50px 90px -30px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-16px) rotate(1deg); }
}

.hero-dark .usecases { margin-top: 56px; padding-bottom: 44px; border-top-color: rgba(255, 255, 255, 0.1); }
.hero-dark .usecases-label { color: #8F9BB3; }
.hero-dark .usecase {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #E9EEF6;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background-color 0.3s ease, translate 0.4s var(--ease-cine);
}
.hero-dark .usecase:hover { background: rgba(255, 255, 255, 0.11); translate: 0 -3px; }

/* ---------- Heading font ---------- */

:root { --font-display: "Sora", "Inter Tight", system-ui, sans-serif; }
.hero h1, .topic-hero h1, .section-head h2, .cta-panel h2, .topic-band h2, .soon-card h1, .sales-title {
  font-family: var(--font-display);
  font-weight: 650;
  letter-spacing: -0.035em;
}
.hero-dark h1 { font-weight: 700; letter-spacing: -0.045em; line-height: 1.02; }
.section-head h2 { margin-top: 0; }

/* ---------- Live conversation on the hero phone ---------- */

html.chat-anim .phone-thread .pb { display: none; }
html.chat-anim .phone-thread .pb.is-shown { display: block; animation: bubble-in 0.5s var(--ease-cine) both; }
.pb-in { transform-origin: bottom left; }
.pb-out { transform-origin: bottom right; }
@keyframes bubble-in {
  from { opacity: 0; transform: translateY(10px) scale(0.86); }
  to { opacity: 1; transform: none; }
}
.pb-typing {
  align-self: flex-start;
  display: inline-flex;
  gap: 4px;
  padding: 11px 13px;
  border-radius: 17px;
  border-bottom-left-radius: 5px;
  background: #ECEEF2;
  animation: bubble-in 0.35s var(--ease-cine) both;
}
.pb-typing span { width: 7px; height: 7px; border-radius: 50%; background: #8A93A3; animation: typing-dot 1.1s ease-in-out infinite; }
.pb-typing span:nth-child(2) { animation-delay: 0.15s; }
.pb-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-dot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.45; } 30% { transform: translateY(-4px); opacity: 1; } }
.phone-thread { transition: opacity 0.6s ease; }
.phone-thread.is-fading { opacity: 0; }
.phone-input.is-typing { color: var(--ink); }
.phone-input.is-typing::after { content: ""; display: inline-block; width: 1.5px; height: 14px; margin-left: 1px; background: var(--accent); animation: caret 0.9s steps(1) infinite; vertical-align: -2px; }
@keyframes caret { 50% { opacity: 0; } }
.phone-send { transition: background-color 0.2s ease, color 0.2s ease; }
.phone-send.is-ready { background: var(--accent); color: #fff; }

/* ---------- Inbox inside a laptop ---------- */

.showcase-frame.laptop { background: none; border: 0; border-radius: 0; box-shadow: none; overflow: visible; max-width: 1180px; margin: 0 auto; }
.laptop-lid {
  position: relative;
  padding: 2.2% 2.2% 2.6%;
  border-radius: 26px 26px 10px 10px;
  background: linear-gradient(160deg, #2A3244 0%, #121827 60%, #0B1020 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), inset 0 2px 0 rgba(255, 255, 255, 0.06), 0 50px 90px -40px rgba(15, 43, 87, 0.65);
}
.laptop-camera { position: absolute; top: 1%; left: 50%; width: 7px; height: 7px; transform: translateX(-50%); border-radius: 50%; background: #2F3A50; box-shadow: inset 0 0 0 1.5px #1A2130; }
.laptop-screen { position: relative; overflow: hidden; border-radius: 6px; background: #fff; aspect-ratio: 1320 / 676; }
.laptop-fit { position: absolute; top: 0; left: 0; width: 1320px; transform-origin: 0 0; }
.laptop-fit .db { min-width: 1320px; }
.laptop-fit .showcase-scroll { overflow: hidden; }
.laptop-fit .showcase-chrome { border-radius: 0; }
.laptop-base {
  position: relative;
  height: clamp(10px, 1.7vw, 20px);
  margin: 0 -6.5%;
  border-radius: 2px 2px 26px 26px / 2px 2px 16px 16px;
  background: linear-gradient(180deg, #E9EDF3 0%, #C9D0DB 55%, #A7B0BF 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 28px 40px -22px rgba(15, 43, 87, 0.55);
}
.laptop-notch { position: absolute; top: 0; left: 50%; width: 15%; height: 42%; transform: translateX(-50%); border-radius: 0 0 12px 12px; background: linear-gradient(180deg, #A9B2C1, #C3CAD5); }
.showcase .showcase-legend { margin-top: 34px; justify-content: center; }
.showcase .showcase-legend .note { margin-left: 0; width: 100%; text-align: center; }

/* ---------- Pills everywhere ---------- */

.btn { border-radius: 999px; }
.btn-lg { padding: 0 26px; }
.btn-glow { box-shadow: 0 12px 34px -10px rgba(29, 78, 216, 0.85), inset 0 0 0 1px rgba(255, 255, 255, 0.12); transition: background-color 0.2s ease, translate 0.3s var(--ease-cine), box-shadow 0.3s ease; }
.btn-glow:hover { translate: 0 -2px; box-shadow: 0 18px 40px -10px rgba(29, 78, 216, 0.95), inset 0 0 0 1px rgba(255, 255, 255, 0.16); }
.input { border-radius: 999px; padding: 0 18px; }
textarea.input { border-radius: 20px; }

.kicker {
  padding: 7px 14px 7px 12px;
  border-radius: 999px;
  background: var(--teal-soft);
  border: 1px solid #CDEBE8;
}
.kicker::before { width: 7px; height: 7px; border-radius: 50%; }
.kicker-light { background: rgba(95, 214, 210, 0.12); border-color: rgba(95, 214, 210, 0.28); }

.section { padding: 120px 0; }
.section-head h2 { font-size: clamp(2rem, 3.6vw, 3rem); letter-spacing: -0.035em; line-height: 1.12; }
.section-head p { font-size: 18px; }
.cta { padding-bottom: 120px; }

/* Overview: separate floating pills instead of a ruled grid */
.overview-grid { gap: 22px; background: none; border: 0; border-radius: 0; overflow: visible; }
.overview-cell { border: 1px solid var(--border); border-radius: var(--pill-r); box-shadow: var(--float-shadow); padding: 34px 32px 38px; }
.overview-cell::before { display: none; }
.overview-cell:hover { background: #fff; translate: 0 -8px; box-shadow: var(--float-shadow-hover); border-color: #C9D8F2; }
.ov-icon, .benefit-ic, .oc-ic, .tr-ic { border-radius: 999px; }

/* Benefits */
.benefit { border-radius: var(--pill-r); padding: 30px 28px 32px; }
.benefit:hover { translate: 0 -8px; }

/* Steps */
.step { border-radius: var(--pill-r); box-shadow: var(--float-shadow); }
.step:hover { transform: none; translate: 0 -8px; box-shadow: var(--float-shadow-hover); }
.mini { border-radius: 22px; }
.step-num { border-radius: 999px; width: 30px; height: 30px; }
.mini-conv { border-radius: 999px; padding: 8px 12px 8px 9px; }
.mini-bubble { border-radius: 18px 18px 18px 6px; }
.mini-send span { border-radius: 999px; }
.mini-file .ic { border-radius: 999px; }

/* Showcase */
.showcase-frame:not(.laptop) { border-radius: var(--pill-r); }
.showcase-legend .sw { border-radius: 999px; width: 22px; }

/* Testimonials */
.quote-card { border-radius: var(--pill-r); box-shadow: var(--float-shadow); padding: 34px 32px 28px; }
.quote-card::before { display: none; }
.quote-card:hover { translate: 0 -8px; box-shadow: var(--float-shadow-hover); }

/* Call to action */
.cta-panel { border-radius: 48px; padding: 72px 64px; box-shadow: 0 40px 80px -40px rgba(15, 43, 87, 0.6); }

/* Mega-menu tiles */
.mm-tile { border-radius: 999px; }
.mm-item, .mm-link { border-radius: 999px; }
.mm-item { border-radius: 22px; }

/* Topic pages and pricing */
.topic-card { border-radius: var(--pill-r); box-shadow: var(--float-shadow); }
.topic-card::before { display: none; }
.topic-card:hover { transform: none; translate: 0 -8px; box-shadow: var(--float-shadow-hover); }
.topic-tile { border-radius: 999px; padding: 18px 24px 18px 18px; align-items: center; box-shadow: var(--float-shadow); }
.topic-tile:hover { translate: 0 -4px; }
.topic-related { border-radius: var(--pill-r); }
.topic-related a { border-radius: 999px; }
.topic-visual { border-radius: 40px; }
.tv-icon { border-radius: 999px; }
.tv-msg { border-radius: 26px; }
.tv-chips .tag { border-radius: 999px; }
.sales-card { border-radius: var(--pill-r); }
.sales-card::before { display: none; }
.sales-ic { border-radius: 999px; }
.soon-card { border-radius: var(--pill-r); }
.soon-card::before { display: none; }
.soon-url { border-radius: 999px; padding: 6px 14px; }

.tag { border-radius: 999px; padding: 0 9px; }

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .hero.hero-dark { padding-top: calc(var(--header-h) + 64px); }
}
@media (max-width: 760px) {
  .section { padding: 72px 0; }
  .cta { padding-bottom: 72px; }
  .cta-panel { border-radius: 36px; padding: 48px 28px; }
}
@media (max-width: 560px) {
  .hero.hero-dark { padding-top: calc(var(--header-h) + 40px); }
  .hero-dark .hero-visual { padding: 16px 0 24px; }
  .phone-glow { width: 340px; height: 340px; }
  .topic-tile { border-radius: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-aurora span, .phone-glow, .hero-dark .phone { animation: none; }
  .accent-line path { transition: none; }
}
