/* BPH SYSTEMS — Intelligence section. Uses the variables defined in hero.css.
   Logical properties (inline/block) are used so RTL languages can mirror the layout later. */

.intel {
  position: relative;
  padding: clamp(110px, 16vh, 200px) var(--pad-x) clamp(120px, 18vh, 220px);
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(242, 184, 112, 0.05), transparent 70%),
    var(--bg);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.intel__intro { max-width: 1100px; }

/* ---------- 1. pipeline ---------- */
.pipe {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(40px, 7vw, 120px);
  margin-block-start: clamp(60px, 10vh, 120px);
}
/* bottom padding lets the sticky card stay centred while the last step is read */
.pipe__steps { padding-block-end: 16vh; }
.step {
  min-height: 72vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 440px;
  opacity: 0.22;
  transition: opacity 0.7s var(--ease);
}
.step.is-active { opacity: 1; }
.step__num {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--accent);
}
.step__title {
  margin-block: 14px 16px;
  font-size: clamp(26px, 2.3vw, 38px);
  font-weight: 500;
  letter-spacing: -0.02em;
}
.step p { font-size: 17px; line-height: 1.6; color: var(--muted); }

.pipe__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: flex;
  align-items: center;
}

.card {
  width: 100%;
  padding: clamp(22px, 2.4vw, 36px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(242, 184, 112, 0.06), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.008)),
    #070a0f;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.5);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
}
.card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block-end: 16px;
  border-block-end: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
}
.card__brand { color: #fff; font-weight: 600; }
.card__wave { display: block; width: 100%; height: 76px; margin-block: 18px 8px; }

.row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  padding-block: 12px;
  border-block-start: 1px solid rgba(255, 255, 255, 0.05);
}
.row .k { font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--faint); padding-block-start: 2px; }
.row .v { color: rgba(233, 237, 243, 0.9); }
.row .v i { font-style: normal; color: var(--muted); }
.row .say { font-style: italic; color: #fff; font-size: 15px; }
.row--foot .v { color: var(--muted); font-size: 12px; }

.cmds { list-style: none; display: grid; gap: 7px; }
.cmds li {
  display: grid;
  grid-template-columns: 14.5ch minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 10px;
}
.cmds .c { color: var(--accent); }
.cmds .a { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmds .proto {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border: 1px solid rgba(196, 214, 240, 0.25);
  border-radius: 999px;
  color: rgba(214, 226, 244, 0.9);
}
.cmds .st { color: #8fd6a8; text-align: center; }

/* staged visibility, driven by JS (data-at <= current step) */
.js .card [data-at] { opacity: 0; transform: translateY(6px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.js .card .proto[data-at], .js .card .st[data-at] { transform: none; }
.js .card [data-at].on { opacity: 1; transform: none; }
.js .card .row.on:not(.now) { opacity: 0.55; }
/* tags and ticks cascade down the list when they appear (each li sets --i) */
.js .card .cmds .proto.on, .js .card .cmds .st.on { transition-delay: calc(var(--i, 0) * 120ms); }

/* ---------- 2. demo ---------- */
.demo {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(40px, 7vw, 120px);
  align-items: center;
  margin-block-start: clamp(80px, 14vh, 180px);
}
.demo__chips { display: grid; gap: 10px; margin-block-start: 36px; max-width: 460px; }
.chip {
  display: flex;
  align-items: baseline;
  gap: 14px;
  width: 100%;
  padding: 14px 18px;
  text-align: start;
  font: inherit;
  font-size: 16px;
  color: rgba(233, 237, 243, 0.8);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.3s, background 0.3s, color 0.3s;
}
.chip small {
  flex: 0 0 64px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}
.chip:hover { border-color: rgba(255, 255, 255, 0.18); color: #fff; }
.chip[aria-pressed="true"] { border-color: rgba(242, 184, 112, 0.55); background: rgba(242, 184, 112, 0.06); color: #fff; }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.demo__note { margin-block-start: 22px; font-size: 12.5px; color: var(--faint); }

.demo__console {
  min-height: 340px;
  padding: clamp(22px, 2.4vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.008));
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  color: rgba(233, 237, 243, 0.75);
}
.dl { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 10px; padding-block: 5px; animation: dlIn 0.45s var(--ease); }
.dl .k { font-size: 10.5px; letter-spacing: 0.2em; color: var(--faint); padding-block-start: 2px; }
.dl .say { color: #fff; font-style: italic; font-size: 15px; }
.dl .caret { display: inline-block; width: 7px; height: 1.05em; margin-inline-start: 2px; vertical-align: -2px; background: var(--accent); animation: blink 1s steps(1) infinite; }
.dl .cmd { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.dl .cmd .c { color: var(--accent); }
.dl .cmd .a { color: var(--muted); }
.dl .cmd .proto { font-size: 10.5px; padding: 1px 7px; border: 1px solid rgba(196, 214, 240, 0.25); border-radius: 999px; color: rgba(214, 226, 244, 0.9); }
.dl .cmd .st { color: #8fd6a8; opacity: 0; transition: opacity 0.4s; }
.dl .cmd .st.on { opacity: 1; }
.dl--sep { border-block-start: 1px solid rgba(255, 255, 255, 0.06); margin-block-start: 8px; padding-block-start: 12px; }
.dl--foot { color: var(--muted); font-size: 12px; }
@keyframes dlIn { from { opacity: 0; transform: translateY(5px); } }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- 3. care ---------- */
.care {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(40px, 7vw, 120px);
  align-items: center;
  margin-block-start: clamp(120px, 20vh, 240px);
}
.care__panel {
  padding: clamp(22px, 2.4vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.008));
  font-family: var(--mono);
  font-size: 12.5px;
}
.care__head { display: flex; justify-content: space-between; align-items: center; font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint); }
.care__badge {
  padding: 3px 10px;
  border-radius: 999px;
  color: #ffb27a;
  border: 1px solid rgba(255, 150, 90, 0.4);
  background: rgba(255, 150, 90, 0.08);
  opacity: 0;
  transition: opacity 0.6s;
}
.care__panel.alert .care__badge { opacity: 1; }
.care__chart { display: block; width: 100%; height: 200px; margin-block: 22px 18px; overflow: visible; }
.care__log { list-style: none; display: grid; gap: 8px; border-block-start: 1px solid rgba(255, 255, 255, 0.06); padding-block-start: 16px; }
.care__log li { display: grid; grid-template-columns: 9ch 6ch minmax(0, 1fr); gap: 10px; color: rgba(233, 237, 243, 0.75); }
.care__log time { color: var(--faint); }
.js .care__log li { opacity: 0; transform: translateY(5px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); transition-delay: calc(var(--i) * 700ms); }
.care__panel.alert .care__log li { opacity: 1; transform: none; }

/* ---------- 4. trust ---------- */
.trust { margin-block-start: clamp(120px, 20vh, 240px); }
.trust__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 48px);
  margin-block-start: clamp(48px, 7vh, 80px);
}
.trust__item { padding-block-start: 24px; border-block-start: 1px solid rgba(255, 255, 255, 0.1); }
.trust__item:nth-child(2) { transition-delay: 0.12s; }
.trust__item:nth-child(3) { transition-delay: 0.24s; }
.trust__k { font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; color: var(--accent); }
.trust__item h4 { margin-block: 16px 12px; font-size: 22px; font-weight: 500; letter-spacing: -0.01em; }
.trust__item p { font-size: 16px; line-height: 1.6; color: var(--muted); max-width: 36ch; }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .pipe { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .pipe__stage {
    order: -1;
    height: auto;
    padding-block: 14px;
    z-index: 2;
    background: linear-gradient(to bottom, var(--bg) 82%, rgba(4, 6, 10, 0));
  }
  .card { font-size: 11.5px; padding: 18px; border-radius: 16px; }
  .card__wave { height: 44px; margin-block: 12px 4px; }
  .row { grid-template-columns: 54px minmax(0, 1fr); padding-block: 8px; }
  .cmds li { grid-template-columns: 14.5ch minmax(0, 1fr) auto 14px; gap: 6px; }
  /* the card covers the top half, so each step's text sits low and activates in the lower part of the screen */
  .step { min-height: 62vh; justify-content: flex-end; padding-block-end: 4vh; }
  .pipe__steps { padding-block-end: 8vh; }
  .demo, .care { grid-template-columns: minmax(0, 1fr); }
  .trust__grid { grid-template-columns: minmax(0, 1fr); }
}
