/* =============================================================
   Bud OS Stack — interactive eight-product stack component
   Reusable across the homepage, platform page, and product pages.
   Two modes: explore (in-place panel swap) · product (locked + links).
   Built on the existing Bud tokens (tokens.css).
   ============================================================= */

bud-os-stack { display: block; }
/* product mode always follows a page-owned section head; match the 40px
   head-to-visual rhythm those sections use for tables/films */
bud-os-stack[data-mode="product"] { margin-top: 40px; }
bud-os-stack .os-wrap { max-width: 1200px; margin: 0 auto; }

/* ---------- optional internal header (off by default; pages own their lead) ---------- */
bud-os-stack .os-head { margin-bottom: 26px; }
bud-os-stack .os-head .os-eyebrow {
  font-size: 12px; font-weight: 800; letter-spacing: .18em;
  text-transform: uppercase; color: var(--bud-electric-2); margin-bottom: 10px;
}
bud-os-stack .os-head h2 {
  font-family: var(--font-sans); font-size: clamp(24px, 3vw, 34px);
  font-weight: 700; line-height: 1.1; letter-spacing: -.01em;
  color: var(--fg1); margin: 0;
}

/* ---------- two-column row ---------- */
bud-os-stack .os-row { display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch; }
bud-os-stack .os-col-stack { flex: 1 1 320px; min-width: 280px; display: flex; flex-direction: column; }
bud-os-stack .os-list { display: flex; flex-direction: column; gap: 8px; flex: 1; }

/* ---------- layer row (button in explore · anchor in product) ---------- */
bud-os-stack .os-layer {
  box-sizing: border-box; display: flex; align-items: center; gap: .9em;
  width: 100%; text-align: left; text-decoration: none; cursor: pointer;
  border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px;
  font-family: var(--font-sans); color: inherit; background: var(--surface);
  appearance: none; -webkit-appearance: none; margin: 0;
  transition: background .2s, border-color .2s;
}
bud-os-stack .os-layer:not(.is-active):hover {
  background: rgba(140,51,239,0.14); border-color: var(--bud-electric-2);
}
bud-os-stack .os-layer.is-active {
  background: rgba(140,51,239,0.18); border-color: var(--bud-electric); cursor: default;
}
bud-os-stack .os-layer:focus-visible {
  outline: 2px solid var(--bud-electric); outline-offset: 2px;
}

bud-os-stack .os-num {
  font-size: 13px; font-weight: 800; color: var(--bud-electric);
  min-width: 1.9em; letter-spacing: .03em; flex-shrink: 0;
}
bud-os-stack .os-textblock { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
bud-os-stack .os-name { font-size: 15px; font-weight: 700; color: var(--fg1); line-height: 1.15; }
bud-os-stack .os-desc { font-size: 12.5px; color: var(--fg2); line-height: 1.35; }
bud-os-stack .os-chip {
  font-size: 11px; font-weight: 700; letter-spacing: .03em; color: var(--bud-electric-2);
  background: rgba(140,51,239,0.12); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 10px; white-space: nowrap; flex-shrink: 0;
}

/* ---------- detail panel ---------- */
bud-os-stack .os-col-detail { flex: 2 1 420px; min-width: 340px; display: flex; position: relative; }
bud-os-stack .os-card {
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  gap: 22px; width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px 30px; overflow: hidden;
  box-shadow: 0 12px 30px -8px rgba(0,0,0,0.55);
}
bud-os-stack .os-anim { animation: os-cross .32s cubic-bezier(.22,1,.36,1); }
@keyframes os-cross { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  bud-os-stack .os-anim { animation: none !important; }
}

bud-os-stack .os-stripe {
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--bud-electric) 0%, var(--bud-electric-2) 100%);
}

/* head */
bud-os-stack .os-card-head { padding-right: 48px; }
bud-os-stack .os-card-eyebrow {
  font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  color: var(--bud-electric-2); margin-bottom: 8px;
}
bud-os-stack .os-card-title {
  font-family: var(--font-sans); font-size: 30px; font-weight: 700; line-height: 1.05;
  letter-spacing: -.01em; color: var(--fg1); margin: 0 0 8px;
}
bud-os-stack .os-card-title span { color: var(--bud-electric); }
bud-os-stack .os-card-short {
  font-size: 14px; font-style: italic; color: var(--bud-electric-3);
  line-height: 1.4; margin: 0; max-width: 95%;
}

/* section heading (shared by summary / benefits / capabilities) */
bud-os-stack .os-sec-head {
  display: flex; align-items: center; gap: .5em; font-size: 11px; font-weight: 800;
  letter-spacing: .16em; text-transform: uppercase; color: var(--bud-electric-2);
  padding-bottom: 8px; margin-bottom: 10px; border-bottom: 1px solid var(--border);
}
bud-os-stack .os-sec-head::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--bud-electric);
  flex-shrink: 0; box-shadow: 0 0 0 3px rgba(140,51,239,0.18);
}
bud-os-stack .os-para { font-size: 13.5px; color: var(--fg2); line-height: 1.55; margin: 0; }
bud-os-stack .os-para strong { color: var(--fg1); font-weight: 600; }

/* key capabilities grid */
bud-os-stack .os-caps { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
bud-os-stack .os-cap {
  display: flex; align-items: flex-start; gap: .6em; background: rgba(140,51,239,0.06);
  border: 1px solid var(--border); border-left: 3px solid var(--bud-electric);
  border-radius: 6px; padding: 11px 12px;
}
bud-os-stack .os-cap-num {
  font-size: 11px; font-weight: 800; color: var(--bud-electric-2);
  letter-spacing: .06em; flex-shrink: 0; margin-top: 1px;
}
bud-os-stack .os-cap-title { font-size: 12.5px; font-weight: 600; color: var(--fg1); line-height: 1.3; }

/* stepper arrows (explore only) */
bud-os-stack .os-stepper { position: absolute; top: 20px; right: 22px; display: flex; flex-direction: column; gap: 6px; z-index: 3; }
bud-os-stack .os-step {
  width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(140,51,239,0.14); border: 1px solid var(--bud-electric-2); color: var(--bud-electric-2);
  cursor: pointer; padding: 0; appearance: none; -webkit-appearance: none;
  transition: background .15s, color .15s;
}
bud-os-stack .os-step:not(:disabled):hover { background: var(--bud-electric); color: #fff; }
bud-os-stack .os-step:disabled { opacity: .3; cursor: default; }
bud-os-stack .os-step:focus-visible { outline: 2px solid var(--bud-electric); outline-offset: 2px; }
bud-os-stack .os-step svg { display: block; }

/* ---------- responsive: hide the detail panel on phones ---------- */
@media (max-width: 720px) {
  bud-os-stack .os-col-detail { display: none !important; }
}
