/*
  Homepage v2 — additions on top of bv-site.css.
  Same tokens and rhythm. Adds the live hero stage, the Opportunity Brief session window
  and the rule specimens. Every colour, length and curve is a BaseMod AI token.
*/

/* ---------- hero ---------- */
.v2-hero { position: relative; overflow: hidden; background: var(--background); color: var(--text-primary); padding: clamp(56px, 6.1cqi, 88px) 0 clamp(64px, 6.7cqi, 104px); }
.v2-hero .bv-head { gap: 22px; margin-bottom: clamp(36px, 3.6cqi, 52px); max-width: 1100px; }
.v2-hero-title .bm-headline { font-size: clamp(42px, 4.6cqi, 66px); line-height: 1.04; font-weight: 800; letter-spacing: -0.025em; }
.v2-hero-title .bm-headline .muted { display: block; font-weight: 800; }
.v2-atmos { position: absolute; top: 30%; right: 0; bottom: 0; left: 0; pointer-events: none; }
.v2-atmos img {
  position: absolute; left: 50%; top: 0; width: max(1500px, 125%); max-width: none; height: auto; transform: translateX(-50%); opacity: 0.6;
  -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent); mask-image: radial-gradient(closest-side, #000 55%, transparent);
}
.v2-atmos::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, var(--background) 0%, transparent 22%, transparent 72%, var(--background) 100%); }
.v2-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(60% 45% at 50% 20%, #000, transparent 80%); mask-image: radial-gradient(60% 45% at 50% 20%, #000, transparent 80%);
}
.v2-stage { position: relative; z-index: 1; }
@container bv (max-width: 899px) {
  .v2-atmos { top: 42%; }
  .v2-atmos img { width: 260%; }
}

/* ---------- the session window ---------- */
.v2-demo { container-type: inline-size; container-name: bv; color: var(--text-primary); font-family: var(--font-body); }
.v2-demo[data-framed="true"] { padding: 48px; background: var(--background-dark); }

/* the kind-of-work picker: the system's Tabs, centred, with the window as their panel */
.v2-picker-label { margin: 0 0 4px; text-align: center; font: 500 14px/20px var(--font-sans); color: var(--text-secondary); }
.v2-demo .bm-tabs { gap: 20px; }
.v2-demo .bm-tablist { justify-content: center; border-bottom: 0; overflow-x: auto; scrollbar-width: none; }
.v2-demo .bm-tablist::-webkit-scrollbar { display: none; }
.v2-demo .bm-tab { flex: none; white-space: nowrap; min-height: 44px; }
.v2-demo .bm-tabpanel { color: var(--text-primary); }
.v2-step:disabled { opacity: 0.4; cursor: default; }
.v2-skip { margin-top: 10px; }
.v2-dd-open { color: var(--text-muted) !important; }
.v2-window { overflow: hidden; border: 1px solid var(--border-strong); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow-elegant); text-align: left; }
.v2-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; min-height: 60px; padding: 8px 12px 8px 16px; box-sizing: border-box; border-bottom: 1px solid var(--border); background: var(--surface-sunken); }
.v2-dots { display: flex; gap: 6px; }
.v2-dots span { width: 10px; height: 10px; border-radius: 2px; background: var(--border-strong); }
.v2-url { padding: 4px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); font: 400 12px/16px var(--font-mono); color: var(--text-muted); white-space: nowrap; }
.v2-steps { list-style: none; margin: 0 auto; padding: 3px; display: flex; gap: 2px; border-radius: 10px; border: 1px solid var(--border); background: var(--background); }
.v2-step {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px 0 8px; box-sizing: border-box;
  border: 0; border-radius: 7px; background: transparent; color: var(--text-muted); font: 500 13px/16px var(--font-sans); white-space: nowrap; cursor: pointer;
  transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}
.v2-step:hover { color: var(--text-primary); }
.v2-step-n { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; box-sizing: border-box; border-radius: var(--radius-xs); border: 1px solid var(--border-strong); font: 600 11px/1 var(--font-mono); }
.v2-step[data-done="true"] .v2-step-n { background: var(--success-bg); border-color: var(--success-border); color: var(--success-text); }
.v2-step[aria-current="step"] { background: var(--surface-raised); color: var(--text-primary); }
.v2-step[aria-current="step"] .v2-step-n { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.v2-replay {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; box-sizing: border-box;
  border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); cursor: pointer;
  transition: color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.v2-replay:hover { color: var(--text-primary); border-color: var(--border-strong); }
.v2-step:focus-visible, .v2-replay:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* tall enough for every example's finished brief, so the page never jumps while the tour changes examples */
.v2-body { display: grid; grid-template-columns: 400px minmax(0, 1fr); min-height: 960px; }
.v2-pane-l { min-width: 0; display: flex; flex-direction: column; gap: 16px; padding: 20px; background: var(--background); border-right: 1px solid var(--border); }
.v2-pane-r { min-width: 0; display: flex; flex-direction: column; gap: 16px; padding: 24px; background: var(--surface); }
.v2-pane-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.v2-convo .bm-conversation { gap: 18px; padding: 0; max-width: none; margin: 0; }
/* Response opens with an empty paragraph when its text arrives as a bound value; drop it so bubbles keep their padding */
.v2-demo .bm-response > p:empty { display: none; }
.v2-dock { margin-top: auto; }
.v2-empty {
  flex-grow: 1; min-height: 360px; box-sizing: border-box; padding: 32px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-xl); background: var(--surface-sunken);
}
.v2-empty-title { margin: 6px 0 0; font: 600 16px/1.3 var(--font-sans); color: var(--text-primary); }
.v2-empty-text { margin: 0; max-width: 320px; font: 400 14px/1.5 var(--font-body); color: var(--text-muted); }
.v2-brief { display: flex; flex-direction: column; gap: 10px; }
.v2-dd { font: 400 14px/1.55 var(--font-body); color: var(--text-primary); }
.v2-open { margin-top: 8px; padding: 14px 16px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 20px; border-radius: var(--radius-lg); background: var(--warning-bg); border: 1px solid var(--warning-border); }
.v2-open-count { font: 600 14px/20px var(--font-sans); color: var(--warning-text); }
.v2-open-item { font: 400 13px/1.5 var(--font-body); color: var(--text-primary); }
@container bv (max-width: 899px) {
  .v2-body { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .v2-pane-l { border-right: 0; border-bottom: 1px solid var(--border); }
  .v2-pane-r { padding: 20px; }
  .v2-steps { order: 3; width: 100%; margin: 0; justify-content: space-between; }
  .v2-step-l { display: none; }
  .v2-step[aria-current="step"] .v2-step-l { display: inline; }
  .v2-empty { min-height: 220px; }
  .v2-dock[data-later="true"] { display: none; }
  .v2-demo .bm-tablist { justify-content: flex-start; }
  /* the gate's two buttons share the row and wrap instead of running off the edge */
  .v2-demo .bm-gate-actions { flex: 1 1 100%; flex-wrap: wrap; margin-left: 0; }
  .v2-demo .bm-gate-actions > * { flex: 1 1 auto; }
}

/* ---------- rule specimens ---------- */
.v2-rule-head { display: flex; align-items: center; gap: 14px; }
.v2-specimen { flex-grow: 1; margin-top: 8px; padding: 16px; display: flex; flex-direction: column; justify-content: center; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface-sunken); }
@container bv (max-width: 899px) {
  /* on a phone the component is the specimen: no well around it, so it keeps its width */
  .v2-specimen { padding: 0; border: 0; background: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .v2-step, .v2-replay { transition: none; }
}
