/* ------------------------------------------------------------------
   sidspanos.me — tech stack showcase
   Styles for [hud_stack] (inc/stack.php). Loaded only on singulars
   whose content actually contains the shortcode, so no other page
   pays for it. Delete this file + inc/stack.php + the enqueue block
   in functions.php to revert.

   Custom properties (--accent, --panel, --display, --mono ...) are
   declared on .hud in hud.css and inherit down to everything here,
   so this file must stay inside a .hud wrapper. page.php provides it.
   ------------------------------------------------------------------ */

/* The shortcode output sits inside .hud-entry__body, which caps at 76ch so
   ordinary prose stays readable. CSS cannot reach a parent, so inc/stack.php
   marks the document with .has-hud-stack and the cap is lifted here. */
body.has-hud-stack .hud-entry__body,
body.has-hud-stack .hud-entry__body--wide {
  max-width: none;
}

/* page.php pads the body generously for prose. The counter strip is a hard
   edge and does not need that much air above it. */
body.has-hud-stack .hud-entry--page .hud-entry__body { padding-top: 0; margin-top: -1.5rem; }

.hud-entry__body .hud-stack,
.hud-stack {
  max-width: none;
  width: 100%;
  font-family: var(--mono);
  color: var(--text);
}

.hud-stack *,
.hud-stack *::before,
.hud-stack *::after { box-sizing: border-box; }

/* Salient uppercases headings and adds margins inside page content.
   Deliberately NOT a blanket div/span reset — the layout blocks below carry
   their own margins and a blanket rule outranks them on specificity. */
.hud-stack > p,
.hud-stack > h2 { margin: 0; }

.hud-stack h2,
.hud-stack h3,
.hud-stack b,
.hud-stack i { text-transform: none; }

/* --- section heads ------------------------------------------------ */

.hud-stack__eyebrow {
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: 11.5px;
  letter-spacing: .3em;
  text-transform: uppercase !important;
  color: var(--accent);
  margin: 0 0 18px !important;
}
.hud-stack__eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); flex: none;
}
.hud-stack__eyebrow .rule {
  height: 1px; flex: 1;
  background: linear-gradient(to right, rgba(56,255,200,.45), transparent);
}

.hud-stack__h {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(22px, 3.2vw, 30px);
  line-height: 1.1;
  color: #fff;
  letter-spacing: -.015em;
  margin: 0 0 10px !important;
}

.hud-stack__lede {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--dim);
  max-width: 74ch;
  margin: 0 0 34px !important;
}
/* IBM Plex Mono is loaded at 400/500 only. A <b> asks for 700, the browser
   substitutes a different family, and the emphasis reads as a font change
   rather than emphasis. Keep the face, use the weight that exists. */
.hud-stack b,
.hud-stack strong {
  font-family: var(--mono);
  font-weight: 500;
}
.hud-stack .hud-chip b,
.hud-stack .hud-layer__z .t,
.hud-stack__counts .v,
.hud-evcard .t,
.hud-stack__h { font-family: var(--display); font-weight: 600; }

.hud-stack__lede b { color: var(--text); }

/* --- counter strip ------------------------------------------------ */

.hud-stack__counts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  margin: 0 0 54px;
}
.hud-stack__counts > div { background: var(--panel); padding: 16px 18px; }
.hud-stack__counts .k {
  display: block; font-size: 9.5px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--dim); margin-bottom: 7px;
}
.hud-stack__counts .v {
  display: block; font-family: var(--display); font-weight: 600;
  font-size: 24px; line-height: 1; color: var(--text);
}
.hud-stack__counts .v.on { color: var(--accent); }

/* --- chips -------------------------------------------------------- */

.hud-chip {
  border: 1px solid rgba(214,228,230,.16);
  background: #0a0f12;
  padding: 9px 12px;
  min-width: 132px;
  position: relative;
}
.hud-chip::before {
  content: ""; position: absolute; top: -1px; left: -1px;
  width: 9px; height: 9px;
  border: 1px solid rgba(56,255,200,.45);
  border-right: 0; border-bottom: 0;
}
.hud-chip b {
  display: block; font-family: var(--display); font-weight: 600;
  font-size: 13.5px; color: #fff; line-height: 1.15; white-space: nowrap;
}
.hud-chip i {
  display: block; font-style: normal; font-size: 9.5px;
  letter-spacing: .11em; text-transform: uppercase;
  color: var(--dim); margin-top: 5px; white-space: nowrap;
}
.hud-chip--key { border-color: rgba(56,255,200,.45); }
.hud-chip--key b { color: var(--accent); }
.hud-chip--ext { border-color: rgba(255,122,61,.45); }
.hud-chip--ext b { color: var(--warn); }

/* --- the layer stack ---------------------------------------------- */

.hud-stack__layers {
  border: 1px solid var(--line-soft);
  border-bottom: 0;
  margin-bottom: 54px;
}
.hud-layer {
  display: grid;
  grid-template-columns: 216px 1fr;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(90deg, var(--panel-2), var(--panel) 42%);
}
.hud-layer:nth-child(even) {
  background: linear-gradient(90deg, #0c1215, var(--panel) 42%);
}
.hud-layer__z {
  padding: 20px 18px;
  border-right: 1px solid var(--line-soft);
  position: relative;
}
.hud-layer__z::before {
  content: ""; position: absolute; left: 0; top: 20px; bottom: 20px;
  width: 2px; background: var(--accent); opacity: .5;
}
.hud-layer__z .n {
  display: block; font-size: 10px; letter-spacing: .22em; color: var(--accent);
}
.hud-layer__z .t {
  display: block; font-family: var(--display); font-weight: 600;
  font-size: 16px; color: #fff; margin: 8px 0 5px; line-height: 1.15;
}
.hud-layer__z .s {
  display: block; font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--dim);
}
.hud-layer__c {
  padding: 18px;
  display: flex; flex-wrap: wrap; gap: 9px;
  align-content: flex-start;
}

/* --- side rails --------------------------------------------------- */

.hud-stack__rails {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  margin-bottom: 54px;
}
.hud-rail { border: 1px solid var(--line-soft); background: var(--panel); }
.hud-rail__head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--line-soft);
  font-size: 10px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--dim);
}
.hud-rail__head b { color: var(--accent); font-weight: 500; }
.hud-rail__body { padding: 16px; display: flex; flex-wrap: wrap; gap: 8px; }

/* --- evidence cards ----------------------------------------------- */

.hud-stack__sep {
  border: 0;
  border-top: 1px solid var(--line-soft);
  margin: 0 0 44px;
  height: 0;
  background: none;
}

.hud-stack__ev { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

.hud-evcard {
  border: 1px solid var(--line-soft);
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  padding: 20px 20px 18px;
  position: relative;
}
.hud-evcard::before {
  content: ""; position: absolute; top: -1px; left: -1px;
  width: 14px; height: 14px;
  border: 1px solid rgba(255,122,61,.55);
  border-right: 0; border-bottom: 0;
}
.hud-evcard .n {
  display: block; font-size: 10px; letter-spacing: .22em; color: var(--warn);
}
.hud-evcard .t {
  display: block; font-family: var(--display); font-weight: 600;
  font-size: 17px; color: #fff; margin: 9px 0 8px; line-height: 1.25;
}
.hud-evcard .d {
  display: block; font-size: 12.5px; line-height: 1.65; color: var(--dim);
}
.hud-evcard .d b { color: var(--text); font-weight: 500; }

/* --- foot --------------------------------------------------------- */

.hud-stack__foot {
  margin-top: 44px; padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  display: flex; justify-content: space-between; gap: 16px;
  font-size: 10.5px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--dim);
}
.hud-stack__foot .on { color: var(--accent); }

/* --- narrow ------------------------------------------------------- */

@media (max-width: 860px) {
  .hud-stack__counts { grid-template-columns: 1fr 1fr; }
  .hud-layer { grid-template-columns: 1fr; }
  .hud-layer__z {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    padding: 16px 16px 14px;
  }
  .hud-layer__z::before { display: none; }
  .hud-stack__rails,
  .hud-stack__ev { grid-template-columns: 1fr; }
  .hud-chip { min-width: 0; flex: 1 1 auto; }
  .hud-chip b,
  .hud-chip i { white-space: normal; }
  .hud-stack__foot { flex-direction: column; gap: 8px; }
}
