/* =============================================================================
   IntelliBOM · intellibom.ca · Scenario 2 · Ethereal Glass
   bodies.css — the "body ↔ line" drawing (bodies-demo.js) + the bodies page blocks
   Used by: bodies.html (full drawing, page blocks) · index.html (compact drawing) · features.html (teaser)
   Needs styles.css tokens only; does not rely on pages.css.
   ============================================================================= */

/* -----------------------------------------------------------------------------
   1. THE DRAWING — card + switch
   ---------------------------------------------------------------------------*/
.bd {
  /* Face tones: the site's steel palette; emerald when a line lights its body */
  --bd-flat:       #5a5a5a;
  --bd-top:        #a8a8a8;
  --bd-side:       #767676;
  --bd-front:      #4f4f4f;
  --bd-edge:       #050505;
  --bd-lit-top:    #6ee7b7;
  --bd-lit-side:   #10b981;
  --bd-lit-front:  #0b8a61;
  container-type: inline-size;
  position: relative;
  padding: clamp(16px, 2.4vw, 32px);
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 24px;
  -webkit-backdrop-filter: blur(22px);
          backdrop-filter: blur(22px);
}
.bd::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(16, 185, 129, 0.32), transparent);
}
.bd--compact { padding: clamp(14px, 2vw, 26px); }

.bd__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.bd__switch {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  background: var(--void-2);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
}
.bd__thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: var(--glass-hi);
  border: 1px solid var(--line-max);
  transition:
    transform 520ms var(--ease-glass),
    background 320ms var(--ease),
    border-color 320ms var(--ease),
    box-shadow 320ms var(--ease);
}
.bd.is-bodies .bd__thumb {
  transform: translateX(100%);
  background: var(--emerald);
  border-color: var(--emerald);
  box-shadow: 0 0 24px var(--emerald-glow);
}
.bd__opt {
  position: relative;
  z-index: 1;
  padding: 9px 20px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--steel-2);
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: color 260ms var(--ease);
}
.bd__opt:hover,
.bd__opt[aria-pressed="true"] { color: var(--white); }
.bd.is-bodies .bd__opt[aria-pressed="true"] { color: var(--void); font-weight: 700; }
.bd__opt:focus { outline: none; }
.bd__opt:focus-visible { outline: 2px solid var(--emerald-2); outline-offset: 3px; }

/* -----------------------------------------------------------------------------
   2. THE DRAWING — stage + isometric SVG
   ---------------------------------------------------------------------------*/
.bd__stage {
  display: grid;
  gap: 24px;
  align-items: center;
  margin-top: clamp(16px, 2.4vw, 28px);
}
@container (min-width: 820px) {
  .bd__stage {
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
    gap: clamp(28px, 4cqw, 56px);
  }
}
.bd__figure {
  margin: 0;
  display: grid;
  place-items: center;
  min-width: 0;
}
.bd__svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 460px;
  overflow: visible;
}
.bd--compact .bd__svg { max-height: 380px; }
@container (max-width: 560px) {
  .bd .bd__svg { max-height: 260px; }
}
.bd__floor {
  fill: none;
  stroke: rgba(110, 231, 183, 0.13);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.bd__body {
  cursor: pointer;
  transition: opacity 260ms var(--ease);
}
.bd.has-lit .bd__body:not(.is-lit) { opacity: 0.42; }
.bd__face {
  fill: var(--bd-flat);
  stroke: var(--bd-flat);
  stroke-width: 1;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transition: fill 280ms var(--ease), stroke 280ms var(--ease);
}
.bd.is-bodies .bd__face { stroke: var(--bd-edge); stroke-width: 1.5; }
.bd.is-bodies .bd__face--top   { fill: var(--bd-top); }
.bd.is-bodies .bd__face--side  { fill: var(--bd-side); }
.bd.is-bodies .bd__face--front { fill: var(--bd-front); }
/* Lit: one flat emerald with Components only (the whole component), three emerald tones with IntelliBOM */
.bd__body.is-lit .bd__face { fill: var(--bd-lit-side); stroke: var(--bd-lit-side); }
.bd.is-bodies .bd__body.is-lit .bd__face { stroke: var(--bd-edge); }
.bd.is-bodies .bd__body.is-lit .bd__face--top   { fill: var(--bd-lit-top); }
.bd.is-bodies .bd__body.is-lit .bd__face--side  { fill: var(--bd-lit-side); }
.bd.is-bodies .bd__body.is-lit .bd__face--front { fill: var(--bd-lit-front); }

/* -----------------------------------------------------------------------------
   3. THE DRAWING — BOM table + caption
   ---------------------------------------------------------------------------*/
.bd__list {
  container-type: inline-size;
  min-width: 0;
}
.bd__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.bd__table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
  line-height: 1.35;
}
.bd__table th,
.bd__table td {
  padding: 11px 10px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
  transition: background 200ms var(--ease), color 200ms var(--ease), box-shadow 200ms var(--ease);
}
.bd__table thead th {
  padding-top: 4px;
  font-family: var(--f-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--steel-2);
  border-bottom-color: var(--line-strong);
}
.bd__w-qty   { width: 46px; }
.bd__w-mat   { width: 21%; }
.bd__w-stock { width: 23%; }
.bd__w-mass  { width: 82px; }
.bd__w-cost  { width: 76px; }
.bd__table tbody th { font-weight: 500; color: var(--white); }
.bd__table .bd__num {
  text-align: right;
  font-family: var(--f-mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--steel);
}
.bd__table thead .bd__num { font-size: 11.5px; color: var(--steel-2); }
.bd__wide { font-size: 13px; color: var(--steel-2); }
.bd__meta { display: none; }
.bd__tag {
  display: none;
  margin-left: 6px;
  padding: 2px 8px;
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--emerald-2);
  white-space: nowrap;
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 999px;
  background: var(--emerald-soft);
}
.bd.is-bodies .bd__tag { display: inline-block; }

/* Rows: the body lines hang under the component's line */
.bd__row { cursor: default; }
.bd__row:focus { outline: none; }
.bd__row:focus-visible { outline: 2px solid var(--emerald-2); outline-offset: -2px; }
.bd__row.is-lit > * { background: rgba(16, 185, 129, 0.1); }
.bd__row.is-lit > th { box-shadow: inset 2px 0 0 var(--emerald); }
.bd__row.is-lit .bd__name { color: var(--emerald-2); }
.bd__row--body > th {
  position: relative;
  padding-left: 30px;
}
.bd__row--body > th::before,
.bd__row--body > th::after {
  content: "";
  position: absolute;
  left: 14px;
  border-left: 1px solid var(--line-max);
}
.bd__row--body > th::before { top: 0; height: 50%; width: 9px; border-bottom: 1px solid var(--line-max); }
.bd__row--body > th::after  { top: 50%; bottom: 0; }
.bd__row--body:last-child > th::after { display: none; }
.bd__row--body {
  transition: opacity 380ms var(--ease-glass), transform 520ms var(--ease-glass), visibility 0s;
  transition-delay: calc(120ms + var(--i, 0) * 90ms);
}
.bd__row--body.is-off {
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 160ms var(--ease), transform 160ms var(--ease), visibility 0s linear 160ms;
}
.bd__row--body.is-off > * { border-bottom-color: transparent; }

.bd__caption {
  margin: 16px 0 0;
  min-height: 3em;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--steel-2);
  text-wrap: pretty;
}
.bd__caption strong { color: var(--white); font-weight: 700; }
.bd.is-bodies .bd__caption strong { color: var(--emerald-2); }

/* Narrow table: the material moves under the line's name; the stock column is left out */
@container (max-width: 520px) {
  .bd__wide { display: none; }
  .bd__meta {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    font-weight: 400;
    color: var(--steel-2);
  }
  .bd__table th,
  .bd__table td { padding: 9px 6px; }
  .bd__row--body > th { padding-left: 26px; }
  .bd__row--body > th::before,
  .bd__row--body > th::after { left: 11px; }
  .bd__w-qty  { width: 34px; }
  .bd__w-mass { width: 70px; }
  .bd__w-cost { width: 64px; }
}

/* First paint and reduced motion: states swap at once */
.bd.is-still .bd__row--body,
.bd.is-still .bd__face,
.bd.is-still .bd__body,
.bd.is-still .bd__thumb,
.bd.is-still .bd__opt { transition: none; }
@media (prefers-reduced-motion: reduce) {
  .bd *,
  .bd *::before,
  .bd *::after { transition-delay: 0s !important; }
}

/* -----------------------------------------------------------------------------
   4. BODIES PAGE — note, split text, rule table, part list
   ---------------------------------------------------------------------------*/
#drawing { scroll-margin-top: 88px; }
.bd-note {
  margin: 16px 0 0;
  max-width: 76ch;
  font-size: 13px;
  line-height: 1.6;
  color: var(--steel-2);
}
.bd-split {
  display: grid;
  gap: 20px 64px;
  align-items: start;
}
@media (min-width: 900px) {
  .bd-split { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
}
.bd-prose p {
  margin: 0 0 16px;
  max-width: 60ch;
  font-size: 17px;
  line-height: 1.75;
  color: var(--steel);
  text-wrap: pretty;
}
.bd-prose p:last-child { margin-bottom: 0; }

.bd-rule {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  -webkit-backdrop-filter: blur(22px);
          backdrop-filter: blur(22px);
}
.bd-rule__table {
  width: 100%;
  border-collapse: collapse;
}
.bd-rule__table th,
.bd-rule__table td {
  padding: 16px clamp(14px, 2vw, 28px);
  text-align: left;
  vertical-align: top;
  font-size: 15.5px;
  line-height: 1.5;
  border-bottom: 1px solid var(--line);
}
.bd-rule__table thead th {
  padding-top: 14px;
  padding-bottom: 14px;
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--steel-2);
  background: rgba(0, 0, 0, 0.22);
}
.bd-rule__table tbody th {
  width: 46%;
  font-weight: 400;
  color: var(--steel);
}
.bd-rule__table td { color: var(--white); }
.bd-rule__table tbody tr:last-child > * { border-bottom: 0; }
.bd-rule__table tbody tr:hover > * { background: rgba(16, 185, 129, 0.04); }
@media (max-width: 560px) {
  .bd-rule__table th,
  .bd-rule__table td { font-size: 14.5px; padding-top: 13px; padding-bottom: 13px; }
}

.bd-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 900px) {
  .bd-list { grid-template-columns: 1fr 1fr; }
  .bd-list li:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
.bd-list li {
  position: relative;
  padding: 18px 22px 18px 48px;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--steel);
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.bd-list li::before {
  content: "";
  position: absolute;
  left: 22px;
  top: 27px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald-glow);
}

/* -----------------------------------------------------------------------------
   5. HOMEPAGE BAND (index.html) + FEATURES TEASER (features.html)
   ---------------------------------------------------------------------------*/
.bd-band {
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--s-section) var(--pad-x);
}
.bd-band__more { margin: 24px 0 0; }

.bd-teaser {
  position: relative;
  display: grid;
  gap: 18px 48px;
  align-items: center;
  padding: clamp(24px, 3vw, 40px);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.04), var(--glass));
  border: 1px solid rgba(16, 185, 129, 0.22);
  border-radius: 24px;
  -webkit-backdrop-filter: blur(22px);
          backdrop-filter: blur(22px);
  overflow: hidden;
}
.bd-teaser::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(16, 185, 129, 0.45), transparent);
}
@media (min-width: 900px) {
  .bd-teaser { grid-template-columns: minmax(0, 1fr) auto; }
}
.bd-teaser__text {
  display: grid;
  gap: 14px;
}
