/* BE Solutions homepage: hero, the demo tabs + stage, the phone demo sheet, "made for you".
   Tokens, nav, buttons, form and footer come from /welcome/styles.css and /welcome/sections.css. */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- hero ---------- */
.home-hero { padding: clamp(40px, 7vw, 88px) 0 clamp(28px, 4vw, 44px); }
.home-hero h1 { font-size: clamp(40px, 6.4vw, 84px); font-weight: 700; margin: 20px 0 0; max-width: 14em; }
.home-hero h1 .serif { font-size: 1.06em; }
.home-hero__lede { margin-top: 22px; max-width: 34em; font-size: clamp(17px, 1.6vw, 20px); color: var(--ink-2); }
.home-hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.js .home-hero .reveal { opacity: 1; transform: none; transition: none; animation: rise-in 0.8s var(--ease-out) var(--d, 0ms) backwards; }
.home-hero .reveal:nth-child(2) { --d: 80ms; }
.home-hero .reveal:nth-child(3) { --d: 160ms; }
.home-hero .reveal:nth-child(4) { --d: 240ms; }

/* ---------- demo categories: three cards; each opens a menu of its tools (hover, click or keyboard) ---------- */
.demos { scroll-margin-top: 68px; }
section.demos { padding-top: clamp(20px, 3vw, 32px); }
.cats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cat { position: relative; }
.cat.is-open { z-index: 25; }
.cat__btn {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 84px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass);
  color: var(--ink-2); font: inherit; text-align: left; cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, transform 0.16s var(--ease-out);
}
.cat__ico { width: 30px; height: 30px; color: var(--muted); transition: color 0.2s; }
.cat__txt { display: grid; gap: 1px; min-width: 0; flex: 1; }
.cat__txt small { font: 600 11px/1.3 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.cat__txt b { font-weight: 600; font-size: 18px; color: var(--ink); }
.cat__now { font: 12px/1.3 var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat__chev { width: 18px; height: 18px; color: var(--muted); transition: transform 0.25s var(--ease-out), color 0.2s; }
.cat__btn:active { transform: scale(0.98); }
/* The category holding the open demo. */
.cat.is-current .cat__btn { border-color: var(--accent); background: rgba(255, 198, 41, 0.08); }
.cat.is-current .cat__ico, .cat.is-current .cat__now { color: var(--accent); }
.cat.is-open .cat__btn { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.06); }
.cat.is-open.is-current .cat__btn { border-color: var(--accent); }
.cat.is-open .cat__chev { transform: rotate(180deg); color: var(--ink); }

.cat__menu {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; min-width: 300px;
  display: grid; gap: 4px; margin: 0; padding: 8px; list-style: none;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--night-2);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(0, 0, 0, 0.2);
  transform-origin: top center;
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(0.98);
  transition: opacity 0.16s var(--ease-out), transform 0.2s var(--ease-out), visibility 0s linear 0.2s;
}
/* An invisible bridge over the 8px gap, so moving the pointer from card to menu doesn't close it. */
.cat__menu::before { content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 10px; }
.cat.is-open .cat__menu { opacity: 1; visibility: visible; transform: none; transition: opacity 0.16s var(--ease-out), transform 0.2s var(--ease-out), visibility 0s; }
.cat:last-child .cat__menu { left: auto; }
.cat__item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: var(--ink-2); font: inherit; text-align: left; cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
.cat__item > .ico:first-child { width: 24px; height: 24px; color: var(--muted); transition: color 0.15s; }
.cat__item span { display: grid; min-width: 0; flex: 1; }
.cat__item b { font-weight: 600; font-size: 15.5px; color: var(--ink); }
.cat__item small { font-size: 13px; line-height: 1.35; color: var(--muted); }
.cat__go { width: 16px; height: 16px; color: var(--accent); opacity: 0; transform: translateX(-4px); transition: opacity 0.15s, transform 0.2s var(--ease-out); }
.cat__item:focus-visible { outline-offset: -2px; }
.cat__item[aria-current='true'] { border-color: rgba(255, 198, 41, 0.4); background: rgba(255, 198, 41, 0.08); }
.cat__item[aria-current='true'] > .ico:first-child { color: var(--accent); }
.cat__item:active { background: rgba(255, 255, 255, 0.08); }
@media (hover: hover) and (pointer: fine) {
  .cat__btn:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.06); }
  .cat.is-current .cat__btn:hover { border-color: var(--accent); }
  .cat__item:hover { background: rgba(255, 255, 255, 0.06); }
  .cat__item:hover > .ico:first-child { color: var(--accent); }
  .cat__item:hover .cat__go, .cat__item:focus-visible .cat__go { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cat__menu, .cat.is-open .cat__menu { transform: none; transition: opacity 0.12s, visibility 0s; }
}

/* ---------- panel + stage ---------- */
.demo-panel { margin-top: 18px; }
.demo-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; margin-bottom: 14px; }
.demo-head h3 { font-size: clamp(22px, 2.4vw, 30px); }
.demo-head__crumb { margin-bottom: 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.demo-head__pitch { margin-top: 6px; max-width: 46em; color: var(--ink-2); }
.demo-head__tools { display: flex; align-items: center; gap: 14px; }
.demo-head__note { font-size: 12px; color: var(--muted); }

.demo-stage {
  position: relative; height: 640px; overflow: hidden;
  border: 1px solid var(--line-strong); border-radius: 22px; background: var(--night-2);
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.8);
}
/* The demo root fills the stage. Undo /welcome's small ".demo" card styles, which share the class name. */
.demo-stage > .demo, .demo-sheet__body > .demo { position: absolute; inset: 0; height: auto; margin: 0; padding: 0; }
.demo-stage > .demo::before, .demo-sheet__body > .demo::before { content: none; }
.demo-stage__msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font: 14px var(--mono); }
.demo-stage__msg[hidden] { display: none; }
.demo-stage__msg a { color: var(--ink); }

/* Phone: the stage is replaced by a poster that opens the demo full screen. */
.demo-poster { display: none; }
@media (max-width: 759px) {
  /* Phone: categories stack, and a category's tools open in place below it, pushing the rest down. */
  .cats { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .cat__btn { min-height: 72px; padding: 12px 14px; }
  .cat__ico { width: 26px; height: 26px; }
  .cat__menu { position: static; min-width: 0; margin-top: 6px; display: none; transform: none; box-shadow: none; }
  .cat__menu::before { content: none; }
  .cat.is-open .cat__menu { display: grid; animation: rise-in 0.25s var(--ease-out); }
  .cat__go { opacity: 1; transform: none; }
  .demo-head__tools { display: none; }
  .demo-stage { display: none; }
  .demo-poster {
    display: grid; justify-items: center; gap: 16px; padding: 30px 20px 24px; text-align: center;
    border: 1px solid var(--line-strong); border-radius: 22px; background: var(--night-2);
  }
  .demo-poster__icon { width: 56px; height: 56px; fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
  .demo-poster p { font-size: 13px; color: var(--ink-2); max-width: 30em; }
}

/* ---------- phone sheet ---------- */
.demo-sheet { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-rows: 56px minmax(0, 1fr); background: var(--night); }
.demo-sheet[hidden] { display: none; }
.demo-sheet__bar {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: center; gap: 8px;
  padding: 0 max(4px, env(safe-area-inset-right)) 0 max(4px, env(safe-area-inset-left));
  padding-top: env(safe-area-inset-top); box-sizing: content-box; height: 56px;
  border-bottom: 1px solid var(--line); background: var(--night-2);
}
.demo-sheet__bar b { text-align: center; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-sheet__btn { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--ink); font-size: 22px; cursor: pointer; }
.demo-sheet__btn:active { background: var(--glass); }
.demo-sheet__body { position: relative; min-height: 0; overflow: hidden; padding-bottom: env(safe-area-inset-bottom); }
.demo-sheet .demo-stage__msg { position: absolute; }
body.sheet-open { overflow: hidden; }

/* ---------- made for you ---------- */
.fit__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.fit__grid li { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass); }
.fit__grid .ico { width: 28px; height: 28px; color: var(--accent); }
.fit__grid h3 { margin-top: 14px; font-size: 20px; }
.fit__grid p { margin-top: 8px; color: var(--ink-2); }
.fit__grid li:nth-child(2) { --d: 80ms; }
.fit__grid li:nth-child(3) { --d: 160ms; }
.fit__more { margin-top: 24px; }
.fit__more a { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 600; text-underline-offset: 4px; }
@media (max-width: 860px) { .fit__grid { grid-template-columns: minmax(0, 1fr); } }

/* The brand name has a real space between BE and Solutions here, so its accessible name reads "BE Solutions". */
.brand__name span { margin-left: 0; }
