/* YBeeM swarm — marketing site. Two-axis theming (colour × light/dark) matching the
   dashboard: data-theme sets the accent, data-mode sets the neutral base. No build. */

:root {
  --bg: #ffffff; --surface: #ffffff; --soft: #f5f6f8;
  --ink: #1b1d21; --muted: #6b7280; --line: #e6e8eb;
  --accent: #e0940a; --accent-ink: #9a6100;
  --radius: 16px; --max: 66rem;
  --shadow: 0 1px 2px rgba(20,22,26,.06), 0 8px 24px rgba(20,22,26,.06);
}
[data-mode="dark"] {
  --bg: #14161a; --surface: #1b1e24; --soft: #1f242b;
  --ink: #e7e9ee; --muted: #9aa3b0; --line: #262b33;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
}
[data-mode="oled"] {
  --bg: #000; --surface: #0a0a0a; --soft: #101010;
  --ink: #eaeaea; --muted: #8a8a8a; --line: #1a1a1a;
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 10px 30px rgba(0,0,0,.6);
}
[data-theme="bee"]    { --accent: #e0940a; --accent-ink: #9a6100; }
[data-theme="meadow"] { --accent: #2e9e4f; --accent-ink: #1f7d3a; }
[data-theme="ocean"]  { --accent: #1f7fd6; --accent-ink: #1668b0; }
[data-theme="berry"]  { --accent: #a23bc9; --accent-ink: #8226a6; }
[data-theme="slate"]  { --accent: #5b6b82; --accent-ink: #3f4a5c; }
[data-mode="dark"],[data-mode="oled"] { --accent-ink: color-mix(in srgb, var(--accent) 58%, #fff); }
:root { --accent-weak: color-mix(in srgb, var(--accent) 14%, var(--bg)); --accent-soft: color-mix(in srgb, var(--accent) 22%, var(--bg)); }
/* Filled-button surface: a deeper shade of the accent so white label text clears
   WCAG AA (4.5:1) even on the lightest themes (bee/meadow), where white on the raw
   bright accent is only ~2.5:1. */
:root { --btn: color-mix(in srgb, var(--accent) 62%, #000); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased;
  transition: background .2s, color .2s;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { letter-spacing: -.02em; line-height: 1.1; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }
.eyebrow { color: var(--accent-ink); font-weight: 700; font-size: .78rem; letter-spacing: .09em; text-transform: uppercase; }

/* nav */
header.nav { border-bottom: 1px solid var(--line); position: sticky; top: 0; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); z-index: 20; }
.nav-in { display: flex; align-items: center; gap: 1rem; padding: .75rem 0; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; color: var(--ink); font-size: 1.05rem; }
.brand svg { display: block; color: var(--accent); }
.nav-links { margin-left: auto; display: flex; gap: 1.1rem; align-items: center; }
.nav-links > a { color: var(--muted); font-weight: 500; font-size: .95rem; }
.nav-links > a:hover { color: var(--ink); text-decoration: none; }
.btn { display: inline-flex; align-items: center; gap: .4rem; background: var(--btn); color: #fff; padding: .55rem 1rem; border-radius: 10px; font-weight: 600; border: 1px solid var(--btn); cursor: pointer; }
.btn:hover { filter: brightness(1.05); text-decoration: none; color: #fff; }
.btn.ghost { background: transparent; color: var(--accent-ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--soft); }
.btn.lg { padding: .7rem 1.25rem; font-size: 1.02rem; }

/* mobile menu toggle (hamburger) — hidden on desktop */
.menu-btn { display: none; margin-left: auto; align-items: center; background: transparent; border: 1px solid var(--line); border-radius: 10px; padding: .35rem; color: var(--ink); cursor: pointer; }
.menu-btn svg { display: block; width: 1.4rem; height: 1.4rem; }
.menu-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* icon theme picker */
.picker { display: flex; align-items: center; gap: .5rem; padding: .25rem .45rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.swatches { display: flex; gap: .3rem; }
.sw { width: 1.15rem; height: 1.15rem; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; background: var(--c); position: relative; }
.sw[aria-pressed="true"] { border-color: var(--ink); }
.sw:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pipe { width: 1px; height: 1.1rem; background: var(--line); }
.modes { display: flex; gap: .1rem; }
.mode-btn { display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.mode-btn svg { width: 1.05rem; height: 1.05rem; }
.mode-btn[aria-pressed="true"] { background: var(--accent-weak); color: var(--accent-ink); }
.mode-btn:hover { color: var(--ink); }

/* hero */
.hero { padding: 4.5rem 0 3rem; display: grid; grid-template-columns: 1.05fr .95fr; gap: 2.5rem; align-items: center; }
.hero h1 { margin: .2rem 0 1rem; }
/* Brand wordmark + tagline hero title, matching the house style (name as the title,
   the pitch demoted to a tagline). "swarm" picks up the theme accent. */
.hero h1 .brand-xl { display: block; font-size: clamp(2.6rem, 6.5vw, 4rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.02; }
.hero h1 .brand-xl .sc { color: var(--accent-ink); }
.hero h1 .tagline { display: block; font-size: clamp(1.2rem, 3vw, 1.8rem); color: var(--muted); font-weight: 700; margin-top: .55rem; letter-spacing: -.01em; line-height: 1.15; }
.hero .lead { font-size: 1.18rem; color: var(--muted); margin: 0 0 1.7rem; }
.cta-row { display: flex; gap: .7rem; flex-wrap: wrap; }
.trust { margin-top: 1.4rem; color: var(--muted); font-size: .85rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.trust b { color: var(--ink); }

/* hero video-wall visual (auto-animating) */
.wallviz { aspect-ratio: 16/10; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); padding: .6rem; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(3, 1fr); gap: .5rem; }
.tile { border-radius: 8px; background-image: conic-gradient(from 210deg at 60% 40%, var(--accent), color-mix(in srgb, var(--accent) 45%, #6a5cff), color-mix(in srgb, var(--accent) 65%, #17b3a3), var(--accent)); background-size: 400% 300%; opacity: .38; transform: scale(.97); transition: opacity .5s, transform .5s; }
.tile.lit { opacity: 1; transform: scale(1); }

/* hero product mockup — frames the animated wall as the dashboard's video-wall view,
   so the hero reads as the actual UI rather than a bare gradient */
.hero-shot { margin: 0; }
.mockup { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.mk-bar { display: flex; align-items: center; gap: .4rem; padding: .55rem .8rem; border-bottom: 1px solid var(--line); background: var(--soft); }
.mk-dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--line); }
.mk-dot:nth-child(1) { background: #ec6a5e; }
.mk-dot:nth-child(2) { background: #f4bf4f; }
.mk-dot:nth-child(3) { background: #61c454; }
.mk-url { margin-left: .5rem; font-size: .72rem; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: .1rem .7rem; white-space: nowrap; }
.mk-body { display: grid; grid-template-columns: 3.4rem 1fr; gap: .7rem; padding: .7rem; }
.mk-rail { display: flex; flex-direction: column; gap: .35rem; }
.mk-brand { height: 1rem; border-radius: 5px; background: var(--accent); }
.mk-nav { height: .5rem; border-radius: 4px; background: var(--soft); }
.mk-nav.on { background: var(--accent-weak); }
.mk-main { min-width: 0; }
.mk-main .wallviz { border: 0; box-shadow: none; padding: 0; background: transparent; aspect-ratio: 16/9; }
.hero-shot figcaption { margin-top: .75rem; color: var(--muted); font-size: .85rem; text-align: center; line-height: 1.45; }

/* sections */
section { padding: 3.5rem 0; border-top: 1px solid var(--line); }
section h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0 0 .4rem; }
section .sub { color: var(--muted); max-width: 44rem; margin: 0 0 2rem; font-size: 1.05rem; }

/* feature grid */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr)); gap: 1rem; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; background: var(--surface); box-shadow: var(--shadow); }
.card h3 { margin: .1rem 0 .45rem; font-size: 1.08rem; }
.card p { color: var(--muted); margin: 0; font-size: .95rem; }
.ic { width: 2.4rem; height: 2.4rem; border-radius: 10px; background: var(--accent-weak); color: var(--accent-ink); display: grid; place-items: center; margin-bottom: .7rem; }
.ic svg { width: 1.3rem; height: 1.3rem; }

/* interactive demo */
.demo { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.6rem; align-items: start; }
.demo-stage { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); padding: 1rem; }
#demoGrid { display: grid; gap: .5rem; aspect-ratio: 16/9; }
.dcell { border-radius: 10px; border: 1.5px dashed var(--line); display: grid; place-items: center; color: var(--muted); font-size: .8rem; position: relative; overflow: hidden; transition: border-color .2s; }
.dcell.over { border-color: var(--accent); }
.dcell.filled { border-style: solid; border-color: transparent; color: #fff; }
.dcell .frag { position: absolute; inset: 0; background-image: conic-gradient(from 210deg at 55% 45%, var(--accent), color-mix(in srgb, var(--accent) 45%, #6a5cff), color-mix(in srgb, var(--accent) 70%, #17b3a3), var(--accent)); background-size: var(--bgs); background-position: var(--bgp); }
.dcell .lbl { position: relative; z-index: 1; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.4); }
.demo-side .tray { display: flex; flex-wrap: wrap; gap: .45rem; margin: .6rem 0 1rem; }
/* Chips are real <button>s (focusable + Enter/Space), so reset the native button look. */
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .7rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: .88rem; line-height: 1; cursor: grab; user-select: none; box-shadow: var(--shadow); }
.chip::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--ok, #22a559); flex: none; }
.chip:hover { border-color: var(--accent-soft); }
.chip.dragging { opacity: .45; }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.demo-controls { display: flex; align-items: center; gap: .6rem; margin-top: .4rem; flex-wrap: wrap; }
.demo-note { color: var(--muted); font-size: .9rem; margin-top: .8rem; }

/* live demo kiosk embed (revealed by home.js when a kiosk is configured) */
.livekiosk { margin-top: 2.2rem; }
.lk-bar { display: flex; align-items: center; gap: .8rem; margin-bottom: .7rem; flex-wrap: wrap; }
.lk-live { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; }
.lk-live[hidden] { display: none; }
.lk-dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--ok, #22a559); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok, #22a559) 22%, transparent); animation: lkpulse 2s ease-in-out infinite; }
.lk-bar .btn { margin-left: auto; }
.lk-example { color: var(--muted); font-weight: 600; }
.lk-frame { position: relative; aspect-ratio: 16/9; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #000; box-shadow: var(--shadow); }
.lk-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
/* Always-on poster so the panel is never blank; home.js hides it once a live frame loads. */
.lk-poster { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* [hidden] alone loses to the class rules above (author > UA at equal specificity),
   so re-assert display:none for the hidden state home.js toggles. */
.lk-poster[hidden] { display: none; }
.lk-frame img[hidden] { display: none; }
@keyframes lkpulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
@media (prefers-reduced-motion: reduce) { .lk-dot { animation: none; } }

/* integrations */
.integrations { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .8rem; }
.intg { display: flex; gap: .7rem; align-items: flex-start; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.intg .ic { margin: 0; width: 2rem; height: 2rem; flex: none; }
.intg h4 { margin: 0 0 .15rem; font-size: .98rem; }
.intg p { margin: 0; color: var(--muted); font-size: .86rem; }
.pill-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.4rem; }
.pill { border: 1px solid var(--line); background: var(--soft); border-radius: 999px; padding: .35rem .8rem; font-size: .85rem; color: var(--ink); }
.pill b { color: var(--accent-ink); }

/* steps */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr)); gap: 1rem; counter-reset: step; }
.step { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.3rem; position: relative; background: var(--surface); }
.step::before { counter-increment: step; content: counter(step); position: absolute; top: -.85rem; left: 1.2rem; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--btn); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .95rem; }
.step h3 { margin: .5rem 0 .35rem; font-size: 1.04rem; }
.step p { color: var(--muted); margin: 0; font-size: .92rem; }

/* product screenshot figure (themed floorplan mockup) */
.shot { margin: 2.2rem 0 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); padding: 1rem; }
.shot svg { display: block; width: 100%; height: auto; border-radius: 10px; }
.shot figcaption { margin-top: .8rem; color: var(--muted); font-size: .85rem; text-align: center; }
.fp-bg { fill: var(--soft); }
.fp-wall { fill: none; stroke: var(--line); stroke-width: 2; }
.fp-room { fill: var(--bg); stroke: var(--line); stroke-width: 1.5; }
.fp-label { fill: var(--muted); font: 600 12px system-ui, -apple-system, sans-serif; }
.fp-pin { fill: var(--surface); stroke: var(--accent); stroke-width: 2.5; }
.fp-on { fill: #22a559; }
.fp-off { fill: var(--muted); }

/* callout / licensing */
.callout { background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.7rem; }
.callout code { background: var(--surface); border: 1px solid var(--line); padding: .12rem .4rem; border-radius: 6px; font-size: .9em; }
.callout .price { margin: 0 0 1.1rem; display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.price-amt { font-size: 1.9rem; font-weight: 800; color: var(--ink); letter-spacing: -.02em; line-height: 1; }
.price-unit { color: var(--muted); font-weight: 600; }

/* footer */
footer { border-top: 1px solid var(--line); padding: 2.6rem 0; color: var(--muted); font-size: .9rem; }
.foot-in { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.foot-in .nav-links { margin-left: auto; }
.foot-legal { margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.foot-legal .nav-links { margin-left: 0; gap: 1.1rem; flex-wrap: wrap; font-size: .82rem; }

/* docs page */
.doc { padding: 3rem 0; }
.doc h2 { margin-top: 2.2rem; }
.doc pre { background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; overflow: auto; font-size: .9rem; }
.doc code { background: var(--soft); border: 1px solid var(--line); padding: .1rem .35rem; border-radius: 5px; }
.doc pre code { border: 0; padding: 0; background: none; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 1.6rem; }
  .demo { grid-template-columns: 1fr; }
  /* Collapse the HEADER nav (links, theme picker, Sign in) into a dropdown behind the
     hamburger, so nothing overflows and Sign in / Docs stay reachable on phones. Scoped
     to `.nav-in` so the footer's `.nav-links` is untouched. A <noscript> block (in the
     page head) forces this panel open when JS is off, so it degrades gracefully. */
  .nav-in { position: relative; }
  .nav-in .menu-btn { display: inline-flex; }
  .nav-in .nav-links {
    position: absolute; top: calc(100% + .5rem); left: 0; right: 0; margin: 0;
    flex-direction: column; align-items: stretch; gap: .1rem;
    background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
    box-shadow: var(--shadow); padding: .5rem; display: none;
  }
  .nav-in .nav-links.open { display: flex; }
  .nav-in .nav-links > a:not(.btn) { padding: .6rem .5rem; border-radius: 8px; color: var(--ink); }
  .nav-in .nav-links > a:not(.btn):hover { background: var(--soft); text-decoration: none; }
  .nav-in .picker { align-self: flex-start; margin: .35rem .5rem; }
  .nav-in .nav-links > .btn { justify-content: center; margin-top: .35rem; }
}
@media (prefers-reduced-motion: reduce) { .tile { transition: none; } }
