/* BPH SYSTEMS — Energy section. Uses variables from hero.css and shared type from intelligence.css. */

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

/* ---------- day in the life (scroll-driven) ---------- */
.eday { position: relative; height: 340vh; margin-block-start: clamp(40px, 6vh, 80px); }
.eday__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: flex;
  align-items: center;
}
.eday__panel {
  width: 100%;
  padding: clamp(20px, 2.4vw, 36px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  background:
    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);
}

.eday__top { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.eday__clock { display: flex; flex-direction: column; gap: 6px; }
.eday__time {
  font-size: clamp(44px, 5vw, 80px);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.eday__scope-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }

.eday__tabs {
  display: inline-flex;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
}
.eday__tab {
  font: inherit;
  font-size: 13px;
  padding: 8px 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}
.eday__tab:hover { color: #fff; }
.eday__tab[aria-selected="true"] { background: rgba(242, 184, 112, 0.14); color: #fff; }
.eday__tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.eday__body {
  display: grid;
  grid-template-columns: minmax(220px, 0.32fr) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 48px);
  margin-block-start: clamp(20px, 3vh, 36px);
}

.eday__read { display: grid; gap: 2px; }
.eday__read > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-block: 9px;
  border-block-end: 1px solid rgba(255, 255, 255, 0.05);
}
.eday__read dt { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.eday__read dd { font-size: 20px; font-weight: 400; font-variant-numeric: tabular-nums; }
.eday__read dd small { font-size: 11px; color: var(--faint); margin-inline-start: 2px; }
.eday__grid-row dd { color: #fff; font-weight: 600; }

.sw { display: inline-block; width: 14px; height: 3px; border-radius: 2px; flex: none; }
.sw--pv { background: var(--accent); }
.sw--base { background: rgba(196, 214, 240, 0.75); }
.sw--ev { background: #fff; }
.sw--grid { background: transparent; border: 1px solid rgba(255, 255, 255, 0.6); height: 8px; width: 8px; border-radius: 50%; }
.sw--ghost { background: repeating-linear-gradient(90deg, rgba(233, 237, 243, 0.5) 0 3px, transparent 3px 7px); }

.eday__log {
  list-style: none;
  margin-block-start: 22px;
  display: grid;
  gap: 8px;
  min-height: 8.6em;
  align-content: start;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.45;
}
.eday__log li {
  display: grid;
  grid-template-columns: 5.5ch 8.5ch minmax(0, 1fr);
  gap: 8px;
  color: rgba(233, 237, 243, 0.4);
  transition: color 0.5s;
}
.eday__log li.now { color: rgba(233, 237, 243, 0.92); animation: logIn 0.5s var(--ease); }
.eday__log time { color: var(--faint); }
.eday__log b { font-weight: 500; color: rgba(214, 226, 244, 0.85); }
.eday__log b.acc { color: var(--accent); }
@keyframes logIn { from { opacity: 0; transform: translateY(4px); } }

.eday__chart { --chart-h: clamp(220px, 40vh, 380px); position: relative; padding-block-end: 54px; }
.eday__chart svg { display: block; width: 100%; height: var(--chart-h); overflow: visible; }
.eday__cursor {
  position: absolute;
  top: 0;
  height: var(--chart-h);
  width: 1px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.08));
  pointer-events: none;
}
.eday__cursor span {
  position: absolute;
  top: -4px; left: -4px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.6);
}
.eday__cap-label {
  position: absolute;
  right: 0;
  transform: translateY(-140%);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ffb27a;
  pointer-events: none;
}
.eday__hours {
  display: flex;
  justify-content: space-between;
  margin-block-start: 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--faint);
}
.eday__legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-block-start: 14px;
  font-size: 12px;
  color: var(--muted);
}
.eday__legend li { display: flex; align-items: center; gap: 8px; }

/* ---------- KPIs ---------- */
.ekpi {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 48px);
  margin-block-start: clamp(60px, 10vh, 120px);
}
.ekpi__item { padding-block-start: 24px; border-block-start: 1px solid rgba(255, 255, 255, 0.1); }
.ekpi__item:nth-child(2) { transition-delay: 0.12s; }
.ekpi__item:nth-child(3) { transition-delay: 0.24s; }
.ekpi__num {
  display: block;
  font-size: clamp(48px, 5.4vw, 88px);
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.ekpi__item:first-child .ekpi__num { color: var(--accent); }
.ekpi__lbl { display: block; margin-block-start: 14px; font-size: 15px; color: var(--muted); max-width: 26ch; }
.ekpi__note { margin-block-start: 22px; font-size: 12px; color: var(--faint); }

/* ---------- protocols ---------- */
.eproto { margin-block-start: clamp(90px, 14vh, 160px); }
.eproto__title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--faint);
}
.eproto__list { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin-block-start: 26px; }
.eproto__list li {
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.015);
}
.eproto__list b { font-weight: 600; color: var(--fg); margin-inline-end: 4px; }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .eday { height: 300vh; }
  .eday__panel { padding: 16px; border-radius: 16px; }
  .eday__top { align-items: flex-start; }
  .eday__tab { padding: 7px 13px; font-size: 12px; }
  .eday__body { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .eday__side { order: 2; }
  .eday__read { grid-template-columns: 1fr 1fr; column-gap: 16px; }
  .eday__read > div { padding-block: 6px; }
  .eday__read dd { font-size: 15px; }
  .eday__read dt { font-size: 11.5px; gap: 6px; }
  .eday__log { margin-block-start: 10px; min-height: 4.5em; }
  .eday__log li:not(:nth-last-child(-n+2)) { display: none; }
  .eday__chart { padding-block-end: 8px; }
  .eday__chart { --chart-h: 26vh; }
  .eday__legend { display: none; }
  .ekpi { grid-template-columns: minmax(0, 1fr); }
}
