/* ==========================================================================
   blocks.css — the content block vocabulary. includes/blocks.php renders
   these; content files never write raw markup.
   ========================================================================== */

/* --- Page masthead (every interior page) ------------------------------ */
.masthead { padding-block: clamp(56px, 8vw, 128px) clamp(32px, 4vw, 64px); }
.masthead__crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-bottom: var(--s-6); font-family: var(--font-mono); font-size: var(--t-overline); letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-4); }
.masthead__crumbs a { color: var(--fg-3); }
.masthead__crumbs a:hover { color: var(--accent); }
.masthead__crumbs span[aria-hidden] { color: var(--fg-5); }
.masthead__title { max-width: 24ch; margin-bottom: var(--s-6); }
.masthead__lede { max-width: 62ch; }
.masthead__meta { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-8); }

/* --- Entry tiles: activities and industries -------------------------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(268px, 100%), 1fr)); gap: clamp(14px, 1.6vw, 22px); }
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 216px;
  padding: var(--s-6);
  border-radius: var(--r-lg);
  border: 1px solid var(--glass-stroke-1);
  background: var(--glass-tint-1);
  backdrop-filter: blur(var(--glass-blur-md)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur-md)) saturate(var(--glass-saturate));
  box-shadow: var(--shadow-2), var(--glass-inner-lift);
  overflow: clip;
  transition: background var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.tile:hover { background: var(--glass-tint-3); border-color: var(--glass-stroke-3); transform: translateY(-4px); box-shadow: var(--shadow-3), var(--glass-inner-lift); }
/* Each tile carries its own contour signature so a grid of them reads as a
   range of terrain rather than a row of boxes. */
.tile::before {
  content: "";
  position: absolute;
  inset: auto -30% -55% -30%;
  height: 150%;
  z-index: 0;
  opacity: 0.5;
  background: repeating-radial-gradient(circle at var(--tile-cx, 50%) 130%, transparent 0 var(--tile-gap, 22px), var(--fg-5) var(--tile-gap, 22px) calc(var(--tile-gap, 22px) + 1px));
  mask-image: linear-gradient(0deg, #000, transparent 72%);
  -webkit-mask-image: linear-gradient(0deg, #000, transparent 72%);
  transition: opacity var(--dur-3) var(--ease-out);
}
.tile:hover::before { opacity: 0.9; }
.tile > * { position: relative; z-index: 1; }
.tile__risk { position: absolute; top: var(--s-5); right: var(--s-5); z-index: 2; }
.tile__name { font-family: var(--font-display); font-size: var(--t-h5); font-weight: 700; letter-spacing: -0.015em; margin-bottom: var(--s-2); }
.tile__text { font-size: 13.5px; line-height: 1.5; color: var(--fg-3); max-width: 34ch; }
.tile__foot { margin-top: auto; padding-top: var(--s-5); display: flex; flex-wrap: wrap; gap: var(--s-2); }

/* Risk pips, straight from ActivityLibrary's riskLevel. */
.pips { display: inline-flex; gap: 3px; align-items: center; }
.pip { width: 5px; height: 12px; border-radius: 2px; background: var(--fg-5); }
.pip[data-on="true"] { background: var(--accent); }
.pips[data-risk="high"] .pip[data-on="true"],
.pips[data-risk="extreme"] .pip[data-on="true"] { background: var(--amber-400); }

/* --- Section body ----------------------------------------------------- */
/* Blocks inside a section are siblings with nothing between them, so spacing
   used to depend on whichever block happened to carry a bottom margin — a
   callout after a card grid sat flush against it. One column gap here spaces
   every pair on every page, and zeroing the children's own block margins stops
   the two from compounding. */
.section__body { display: flex; flex-direction: column; gap: clamp(28px, 3.5vw, 56px); }
.section__body > * { margin-block: 0; }
.section__body > .rule { margin-block: 0; }

/* --- Feature ladder: numbered rows with a hairline ------------------- */
.ladder { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: clamp(24px, 3vw, 48px) clamp(24px, 3vw, 56px); }
.rung { padding-top: var(--s-5); border-top: 1px solid var(--fg-5); }
.rung__idx { font-family: var(--font-mono); font-size: var(--t-overline); letter-spacing: 0.2em; color: var(--accent); }
.rung__title { font-family: var(--font-display); font-size: var(--t-h5); font-weight: 700; letter-spacing: -0.015em; margin: var(--s-3) 0 var(--s-3); }
.rung__text { font-size: 14.5px; line-height: 1.6; color: var(--fg-3); }
.rung__tags { margin-top: var(--s-4); }

/* --- Layer category cloud -------------------------------------------- */
.cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 1px; border: 1px solid var(--glass-stroke-1); border-radius: var(--r-md); overflow: clip; background: var(--glass-stroke-1); }
.cat {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-5) var(--s-5) var(--s-6);
  background: rgba(8,13,26,0.6);
  backdrop-filter: blur(var(--glass-blur-sm));
  transition: background var(--dur-2) var(--ease-out);
}
.cat:hover { background: rgba(20,32,54,0.8); }
.cat__count { font-family: var(--font-mono); font-size: 26px; font-weight: 500; letter-spacing: -0.03em; color: var(--accent); line-height: 1; }
.cat__name { font-family: var(--font-ui); font-size: 14px; font-weight: 500; color: var(--fg-1); }
.cat__eg { font-size: 12px; line-height: 1.45; color: var(--fg-4); }

/* --- Key/value spec rows (inline, non-tabular facts) ----------------- */
.kv { display: grid; grid-template-columns: minmax(140px, 22%) 1fr; gap: 0; border-top: 1px solid var(--fg-5); }
.kv > dt, .kv > dd { padding: 13px var(--s-4) 13px 0; border-bottom: 1px solid var(--fg-5); margin: 0; }
.kv > dt { font-family: var(--font-mono); font-size: var(--t-overline); letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-4); }
.kv > dd { color: var(--fg-2); font-size: var(--t-body-sm); }
.kv > dd code { color: var(--accent-soft); }

/* --- Timeline / sequence -------------------------------------------- */
.seq { display: flex; flex-direction: column; }
.seq__step { position: relative; padding: 0 0 var(--s-8) var(--s-10); }
.seq__step::before { content: ""; position: absolute; left: 9px; top: 8px; bottom: -8px; width: 1px; background: linear-gradient(180deg, var(--accent), var(--fg-5)); }
.seq__step:last-child { padding-bottom: 0; }
.seq__step:last-child::before { display: none; }
.seq__step::after { content: ""; position: absolute; left: 4px; top: 5px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--accent); background: var(--night-950); }
.seq__t { font-family: var(--font-mono); font-size: var(--t-overline); letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); }
.seq__h { font-family: var(--font-display); font-size: var(--t-h6); font-weight: 700; margin: 6px 0 var(--s-2); }
.seq__b { font-size: 14px; line-height: 1.6; color: var(--fg-3); max-width: 60ch; }

/* --- Curated product / kit cards ------------------------------------- */
.kit { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: clamp(12px, 1.4vw, 18px); }
.kit__item {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-5);
  border-radius: var(--r-md);
  border: 1px solid var(--glass-stroke-1);
  background: var(--glass-tint-1);
  backdrop-filter: blur(var(--glass-blur-sm));
  transition: border-color var(--dur-2) var(--ease-out), background var(--dur-2) var(--ease-out);
}
.kit__item:hover { border-color: var(--accent); background: var(--glass-tint-2); }
.kit__cat { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--fg-4); }
.kit__name { font-family: var(--font-ui); font-size: 14.5px; font-weight: 500; color: var(--fg-1); line-height: 1.35; }
.kit__spec { font-family: var(--font-mono); font-size: 11.5px; color: var(--fg-3); }
.kit__price { margin-top: auto; padding-top: var(--s-3); font-family: var(--font-mono); font-size: 14px; color: var(--accent); }

/* --- Diagram mount (rete.js) ----------------------------------------- */
.diagram {
  position: relative;
  border-radius: var(--r-lg);
  border: 1px solid var(--glass-stroke-2);
  background: rgba(6,10,20,0.62);
  backdrop-filter: blur(var(--glass-blur-md));
  -webkit-backdrop-filter: blur(var(--glass-blur-md));
  box-shadow: var(--shadow-3), var(--glass-inner-lift);
  overflow: clip;
}
.diagram__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--glass-stroke-1);
  background: rgba(10,16,32,0.6);
}
.diagram__title { font-family: var(--font-mono); font-size: var(--t-overline); letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); }
.diagram__hint { margin-left: auto; font-size: 11.5px; color: var(--fg-4); }
.diagram__tools { display: flex; gap: 4px; }
.diagram__tool {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: var(--r-xs);
  border: 1px solid var(--glass-stroke-1);
  background: var(--glass-tint-1);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-2);
  transition: border-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out);
}
.diagram__tool:hover { border-color: var(--accent); color: var(--accent); }
.diagram__canvas { position: relative; height: clamp(420px, 44vw, 560px); }
.diagram__canvas > div { width: 100%; height: 100%; }
.diagram__legend { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-6); padding: var(--s-4) var(--s-5); border-top: 1px solid var(--glass-stroke-1); }
.diagram__key { display: inline-flex; align-items: center; gap: var(--s-2); font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3); }
.diagram__swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.diagram__fallback { padding: var(--s-6); font-size: 13.5px; color: var(--fg-3); }

/* --- Compare CTA band ------------------------------------------------- */
.band {
  position: relative;
  padding: clamp(36px, 5vw, 72px);
  border-radius: var(--r-xl);
  border: 1px solid var(--glass-stroke-2);
  background: var(--glass-tint-2);
  backdrop-filter: blur(var(--glass-blur-lg)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur-lg)) saturate(var(--glass-saturate));
  box-shadow: var(--shadow-3), var(--glass-inner-lift);
  overflow: clip;
}
.band::before {
  content: "";
  position: absolute;
  inset: -60% -10% auto -10%;
  height: 160%;
  z-index: 0;
  opacity: 0.28;
  background: radial-gradient(50% 60% at 80% 100%, var(--accent-glow), transparent 70%);
}
.band > * { position: relative; z-index: 1; }
.band__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: clamp(20px, 3vw, 48px); }
.band__copy { max-width: 46ch; }

/* --- Device / integration strip -------------------------------------- */
.strip { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.strip__item {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 9px 15px;
  border-radius: var(--r-pill);
  border: 1px solid var(--glass-stroke-1);
  background: var(--glass-tint-1);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-2);
  transition: border-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out);
}
.strip__item:hover { border-color: var(--accent); color: var(--fg-1); }
.strip__item::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); opacity: 0.75; }

@media (max-width: 720px) {
  .kv { grid-template-columns: minmax(0, 1fr); }
  .kv > dt { padding-bottom: 0; border-bottom: 0; }
  .kv > dd { padding-top: 4px; }
}


/* --- Contact form ------------------------------------------------------ */
.cform {
  padding: clamp(24px, 3vw, 44px);
  border-radius: var(--r-xl);
  border: 1px solid var(--glass-stroke-2);
  background: var(--glass-tint-1);
  backdrop-filter: blur(var(--glass-blur-md)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur-md)) saturate(var(--glass-saturate));
  box-shadow: var(--shadow-2), var(--glass-inner-lift);
}
.cform__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5); }
.cform__field { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.cform__field--wide { grid-column: 1 / -1; }
.cform__label {
  font-family: var(--font-mono);
  font-size: var(--t-overline);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-4);
}
.cform__input {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  color: var(--fg-1);
  background: rgba(5, 9, 18, 0.55);
  border: 1px solid var(--glass-stroke-2);
  border-radius: var(--r-sm);
  transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.cform__input::placeholder { color: var(--fg-4); }
.cform__input:focus {
  outline: none;
  border-color: var(--amber-400);
  box-shadow: 0 0 0 1px var(--amber-400);
}
.cform__input[aria-invalid="true"] { border-color: var(--crimson-400); }
.cform__textarea { resize: vertical; line-height: 1.55; }
.cform__trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.cform__foot { display: flex; align-items: center; gap: var(--s-5); flex-wrap: wrap; margin-top: var(--s-6); }
.cform__note { font-size: 12.5px; color: var(--fg-4); max-width: 46ch; }
.cform__err {
  margin-bottom: var(--s-5);
  padding: 12px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--crimson-400);
  color: var(--fg-1);
  font-size: 14px;
}
.cform__ok-title { font-family: var(--font-display); font-size: var(--t-h5); font-weight: 700; margin-bottom: var(--s-3); }
.cform__ok-text { color: var(--fg-3); max-width: 52ch; }

@media (max-width: 720px) {
  .cform__grid { grid-template-columns: minmax(0, 1fr); }
}
