/* Mirai Flow — public marketing site (landing + pricing).
 *
 * Self-contained: no external fonts / CDN / images (CSP default-src 'self').
 * Mirai-brand dark by default, #006FFF accent; honors [data-theme="light"] so a
 * visitor who previously chose light mode in the app still sees a sane page.
 * Deliberately independent of style.css (the app shell) so the two never fight,
 * but the accent + logo language match. */

:root {
  --site-bg: #0b0d12;
  --site-bg2: #0f131b;
  --site-card: #141922;
  --site-card2: #1a2029;
  --site-line: #232a35;
  --site-line2: #2f3744;
  --site-txt: #eef1f6;
  --site-txt2: #9aa4b4;
  --site-txt3: #6c7686;
  --accent: #006FFF;
  --accent2: #3a92ff;
  --accent-soft: rgba(0, 111, 255, 0.14);
  --grad: linear-gradient(135deg, #3a92ff 0%, #006FFF 100%);
  --site-radius: 12px;
  --site-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, system-ui, sans-serif;
  --site-maxw: 1080px;
}

:root[data-theme="light"] {
  --site-bg: #f6f8fb;
  --site-bg2: #eef2f7;
  --site-card: #ffffff;
  --site-card2: #f7f9fc;
  --site-line: #e3e6ea;
  --site-line2: #d4d9df;
  --site-txt: #1f2430;
  --site-txt2: #5a6472;
  --site-txt3: #8a94a3;
  --accent: #006FFF;
  --accent2: #005ce0;
  --accent-soft: rgba(0, 111, 255, 0.09);
  --grad: linear-gradient(135deg, #006FFF 0%, #005ce0 100%);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--site-bg);
  -webkit-text-size-adjust: 100%;
}

body.site {
  margin: 0;
  background: var(--site-bg);
  color: var(--site-txt);
  font-family: var(--site-font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ambient brand glow behind everything */
.site-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(42% 34% at 15% 6%, rgba(0, 111, 255, 0.16), transparent 70%),
    radial-gradient(40% 32% at 88% 4%, rgba(58, 146, 255, 0.12), transparent 70%),
    radial-gradient(48% 42% at 72% 92%, rgba(0, 111, 255, 0.08), transparent 70%);
}
:root[data-theme="light"] .site-bg {
  background:
    radial-gradient(42% 34% at 15% 6%, rgba(0, 111, 255, 0.08), transparent 70%),
    radial-gradient(40% 32% at 88% 4%, rgba(0, 111, 255, 0.06), transparent 70%);
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.14; letter-spacing: -0.02em; }
p { margin: 0; }

.wrap {
  max-width: var(--site-maxw);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}
.wrap.narrow { max-width: 640px; }

.ggrad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ── buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  border: 1px solid var(--site-line2);
  background: var(--site-card2);
  color: var(--site-txt);
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}
.btn:hover { border-color: var(--site-line2); background: var(--site-card); transform: translateY(-1px); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { border-color: var(--accent); background: var(--accent-soft); }
.btn.primary {
  border: none;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 111, 255, 0.30);
}
.btn.primary:hover { filter: brightness(1.06); box-shadow: 0 8px 24px rgba(0, 111, 255, 0.42); }
.btn.big { padding: 14px 28px; font-size: 16px; border-radius: 12px; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(0, 111, 255, 0.45); }

/* ── nav ─────────────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--site-bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}
.nav.scrolled { border-bottom: 1px solid var(--site-line); }
.navwrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--accent); }
.brand .logo { flex: none; display: block; }
.brand .word {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--site-txt);
}
.navlinks { display: flex; align-items: center; gap: 12px; }
.navlinks a.navlink {
  color: var(--site-txt2);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 6px;
  transition: color .15s;
}
.navlinks a.navlink:hover { color: var(--site-txt); }
.navlinks a.navlink:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ── hero ────────────────────────────────────────────────────────────── */
.hero { position: relative; padding: 84px 0 72px; overflow: hidden; }
.hero:before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(46% 40% at 50% 0%, rgba(0, 111, 255, 0.18), transparent 70%);
}
.hero .wrap { position: relative; z-index: 1; }
.herogrid {
  display: grid;
  grid-template-columns: 1.05fr 1.15fr;
  gap: 52px;
  align-items: center;
}
.hero-copy .eyebrow {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent2);
  background: var(--accent-soft);
  border: 1px solid var(--site-line);
  border-radius: 999px;
  padding: 5px 12px;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: 46px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 18px;
}
.hero .lead {
  font-size: 18px;
  color: var(--site-txt2);
  max-width: 34ch;
  margin-bottom: 28px;
}
.herobtns { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.herobtns .note { font-size: 13px; color: var(--site-txt3); margin-left: 2px; }

/* ── hero animated diagram mock ──────────────────────────────────────── */
.demo {
  position: relative;
  background: var(--site-card);
  border: 1px solid var(--site-line);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
:root[data-theme="light"] .demo { box-shadow: 0 20px 50px rgba(16, 24, 40, 0.14); }
.demobar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--site-line);
  background: var(--site-card2);
}
.demobar .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--site-line2); }
.demobar .demotitle { margin-left: 8px; font-size: 12.5px; color: var(--site-txt3); font-weight: 600; }
.demostage { display: block; width: 100%; height: auto; background: var(--site-bg2); }

/* SVG diagram animation. Nodes pop in in sequence; edges draw with a flowing
   dash; the whole thing loops so the hero always feels alive. */
.dg-node { opacity: 0; transform-box: fill-box; transform-origin: center;
  animation: dgPop 0.5s ease forwards; }
.dg-label { opacity: 0; animation: dgFade 0.5s ease forwards; }
.dg-edge {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-dasharray: 6 7;
  opacity: 0;
  animation: dgEdgeIn 0.5s ease forwards, dgFlow 1.1s linear infinite;
}
.dg-arrow { fill: var(--accent); opacity: 0; animation: dgFade 0.5s ease forwards; }

/* diagram shape presentation (CSS so it tracks the theme tokens) */
.dg-shape { fill: var(--site-card2); stroke: var(--site-line2); stroke-width: 2; }
.dg-shape.accent { fill: var(--accent-soft); stroke: var(--accent); }
.dg-shape.agent { fill: var(--accent); stroke: var(--accent2); }
.dg-txt {
  fill: var(--site-txt);
  font-family: var(--site-font);
  font-size: 14px;
  font-weight: 600;
  text-anchor: middle;
  dominant-baseline: middle;
}
.dg-txt.on-accent { fill: #fff; }
.dg-elabel {
  fill: var(--site-txt3);
  font-family: var(--site-font);
  font-size: 11px;
  font-weight: 600;
  text-anchor: middle;
}

.d0 { animation-delay: 0.15s; } .d1 { animation-delay: 0.45s; }
.d2 { animation-delay: 0.75s; } .d3 { animation-delay: 1.05s; }
.d4 { animation-delay: 1.35s; } .d5 { animation-delay: 1.65s; }
.d6 { animation-delay: 1.95s; } .d7 { animation-delay: 2.25s; }
.d8 { animation-delay: 2.55s; }

@keyframes dgPop {
  0% { opacity: 0; transform: scale(0.82); }
  70% { opacity: 1; transform: scale(1.03); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes dgFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dgEdgeIn { from { opacity: 0; } to { opacity: 0.9; } }
@keyframes dgFlow { to { stroke-dashoffset: -26; } }

@media (prefers-reduced-motion: reduce) {
  .dg-node, .dg-label, .dg-edge, .dg-arrow { animation-duration: 0.001s; animation-delay: 0s; opacity: 1; }
  .dg-edge { animation: dgEdgeIn 0.001s forwards; }
  .html-scroll { scroll-behavior: auto; }
}

/* ── feature strip ───────────────────────────────────────────────────── */
.section { padding: 66px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.section-head h2 { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 12px; }
.section-head p { color: var(--site-txt2); font-size: 16px; }

.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.feat {
  background: var(--site-card);
  border: 1px solid var(--site-line);
  border-radius: var(--site-radius);
  padding: 22px 20px;
  transition: border-color .18s, transform .18s;
}
.feat:hover { border-color: var(--site-line2); transform: translateY(-2px); }
.feat .featicon {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 14px;
}
.feat h3 { font-size: 16px; font-weight: 700; margin-bottom: 7px; }
.feat p { font-size: 14px; color: var(--site-txt2); line-height: 1.55; }

/* ── how it works ────────────────────────────────────────────────────── */
.how { background: var(--site-bg2); border-top: 1px solid var(--site-line); border-bottom: 1px solid var(--site-line); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.step {
  position: relative;
  padding: 26px 22px;
  background: var(--site-card);
  border: 1px solid var(--site-line);
  border-radius: var(--site-radius);
}
.step .num {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px;
  background: var(--grad);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 14px;
}
.step h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.step p { font-size: 14px; color: var(--site-txt2); }

/* ── pricing teaser ──────────────────────────────────────────────────── */
.teaser { text-align: center; }
.teaser .tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 30px;
  text-align: left;
}
.tier {
  background: var(--site-card);
  border: 1px solid var(--site-line);
  border-radius: var(--site-radius);
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
}
.tier.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.tier .tname { font-size: 15px; font-weight: 700; color: var(--site-txt); }
.tier .tbadge {
  float: right;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 3px 10px;
}
.tier .tprice { font-size: 30px; font-weight: 800; margin: 14px 0 4px; letter-spacing: -0.02em; }
.tier .tprice small { font-size: 14px; font-weight: 600; color: var(--site-txt3); }
.tier .tdesc { font-size: 13.5px; color: var(--site-txt2); margin-bottom: 16px; }
.tier ul { list-style: none; padding: 0; margin: 0 0 20px; }
.tier li { position: relative; padding-left: 24px; font-size: 14px; color: var(--site-txt2); margin: 9px 0; }
.tier li:before {
  content: "";
  position: absolute; left: 0; top: 7px;
  width: 14px; height: 8px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}
.tier .tcta { margin-top: auto; }
.tbc {
  display: inline-block;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent2);
  background: var(--accent-soft);
  border: 1px solid var(--site-line);
  border-radius: 999px;
  padding: 5px 14px;
  margin-bottom: 18px;
}

/* ── cta band ────────────────────────────────────────────────────────── */
.ctaband { text-align: center; }
.ctaband .card {
  background: var(--site-card);
  border: 1px solid var(--site-line);
  border-radius: 18px;
  padding: 48px 32px;
  background-image: radial-gradient(60% 120% at 50% 0%, var(--accent-soft), transparent 70%);
}
.ctaband h2 { font-size: 30px; font-weight: 800; margin-bottom: 12px; }
.ctaband p { color: var(--site-txt2); font-size: 16px; margin-bottom: 26px; }

/* ── footer ──────────────────────────────────────────────────────────── */
.foot { border-top: 1px solid var(--site-line); padding: 30px 0; margin-top: 12px; }
.footwrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--site-txt3);
}
.footwrap .footbrand { display: flex; align-items: center; gap: 8px; color: var(--accent); }
.footwrap .footbrand b { color: var(--site-txt); font-weight: 700; }
.footwrap nav { display: flex; gap: 18px; }
.footwrap nav a { color: var(--site-txt2); transition: color .15s; }
.footwrap nav a:hover { color: var(--site-txt); }

/* ── responsive ──────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .herogrid { grid-template-columns: 1fr; gap: 34px; }
  .hero h1 { font-size: 38px; }
  .hero .lead { max-width: none; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .teaser .tiers { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .hero { padding: 56px 0 52px; }
  .hero h1 { font-size: 31px; }
  .section { padding: 50px 0; }
  .features { grid-template-columns: 1fr; }
  .navlinks a.navlink.hidephone { display: none; }
  .section-head h2, .ctaband h2 { font-size: 26px; }
}
