/* Component Explorer + context-aware RFQ robot — 2026-08-31 */

.valve-explorer-trigger {
  cursor: pointer;
}

.valve-explorer-trigger .showcase-media {
  position: relative;
}

.valve-explorer-pulse {
  position: absolute;
  z-index: 4;
  right: 15px;
  bottom: 14px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #9bd2c7;
  box-shadow: 0 0 0 0 rgba(155, 210, 199, .5);
  animation: valve-pulse 2.4s ease-out infinite;
}

@keyframes valve-pulse {
  0% { box-shadow: 0 0 0 0 rgba(155, 210, 199, .5); }
  68%, 100% { box-shadow: 0 0 0 15px rgba(155, 210, 199, 0); }
}

.valve-explorer-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  color: #b8dcd5;
  border-top: 1px solid rgba(155, 210, 199, .18);
  font-size: 9px;
  letter-spacing: .11em;
}

.valve-explorer-hint b {
  color: #d9b978;
  font-size: 14px;
  transition: transform .35s ease;
}

.valve-explorer-trigger:hover .valve-explorer-hint b,
.valve-explorer-trigger:focus-visible .valve-explorer-hint b {
  transform: translate(3px, 3px);
}

.valve-explorer {
  --valve-accent: #9bd2c7;
  position: relative;
  z-index: 8;
  margin-top: clamp(42px, 6vw, 82px);
  padding: clamp(22px, 3.3vw, 46px);
  overflow: hidden;
  color: #edf3ef;
  border: 1px solid rgba(163, 210, 201, .2);
  border-radius: 28px;
  background:
    radial-gradient(circle at 88% 8%, color-mix(in srgb, var(--valve-accent) 14%, transparent), transparent 30%),
    linear-gradient(145deg, rgba(9, 29, 36, .96), rgba(7, 21, 27, .94));
  box-shadow: 0 38px 100px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .045);
}

.valve-explorer[hidden] { display: none; }

.valve-explorer.is-opening {
  animation: valve-explorer-enter .72s cubic-bezier(.16, 1, .3, 1) both;
}

@keyframes valve-explorer-enter {
  from { opacity: 0; transform: translateY(34px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.valve-explorer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 26px;
}

.valve-explorer-head > div { max-width: 780px; }
.valve-explorer-head .eyebrow { color: var(--valve-accent); }
.valve-explorer-head h3 {
  margin: 8px 0 10px;
  color: #f4f2eb;
  font-family: var(--font-display, "Sora", sans-serif);
  font-size: clamp(2rem, 4.2vw, 4.25rem);
  font-weight: 600;
  line-height: .98;
  letter-spacing: -.045em;
}
.valve-explorer-head p {
  max-width: 680px;
  margin: 0;
  color: #abc0c1;
  font-size: clamp(.93rem, 1.2vw, 1.06rem);
  line-height: 1.7;
}

.valve-explorer-close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px 9px 15px;
  color: #a9bcbd;
  border: 1px solid rgba(169, 196, 192, .16);
  border-radius: 999px;
  background: rgba(255, 255, 255, .025);
  font: 600 10px/1 var(--font-mono, monospace);
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
}
.valve-explorer-close span { color: var(--valve-accent); font-size: 18px; }
.valve-explorer-close:hover { color: #f3f1eb; border-color: color-mix(in srgb, var(--valve-accent) 44%, transparent); }

.valve-stage {
  position: relative;
  min-height: clamp(330px, 35vw, 520px);
  overflow: hidden;
  border: 1px solid rgba(165, 208, 200, .14);
  border-radius: 20px;
  background: #06131d;
  box-shadow: inset 0 -55px 100px rgba(0, 0, 0, .32);
  isolation: isolate;
}

.valve-stage::before {
  content: "ENGINEERED FLOW CONTROL";
  position: absolute;
  z-index: 3;
  top: 20px;
  left: 22px;
  color: color-mix(in srgb, var(--valve-accent) 70%, #fff);
  font: 500 9px/1 var(--font-mono, monospace);
  letter-spacing: .17em;
}

.valve-stage::after {
  content: "DRAG / HOVER TO INSPECT";
  position: absolute;
  z-index: 3;
  top: 20px;
  right: 22px;
  color: rgba(202, 218, 215, .62);
  font: 500 9px/1 var(--font-mono, monospace);
  letter-spacing: .13em;
}

.valve-stage-lineup {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transform: scale(1.015) translate3d(var(--valve-drift-x, 0), var(--valve-drift-y, 0), 0);
  filter: saturate(.88) contrast(1.04) brightness(.98);
  transition: transform .18s ease-out, filter .45s ease;
}

.valve-stage-grid {
  position: absolute;
  z-index: 2;
  inset: 0;
  opacity: .25;
  background-image: linear-gradient(rgba(159, 208, 199, .11) 1px, transparent 1px), linear-gradient(90deg, rgba(159, 208, 199, .11) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 34%, #000 82%, transparent);
          mask-image: linear-gradient(to bottom, transparent, #000 34%, #000 82%, transparent);
  pointer-events: none;
}

.valve-stage-scan {
  position: absolute;
  z-index: 3;
  top: 7%;
  bottom: 18%;
  left: var(--valve-scan-left, 1%);
  width: 20%;
  border: 1px solid color-mix(in srgb, var(--valve-accent) 34%, transparent);
  border-radius: 50%;
  box-shadow: 0 0 54px color-mix(in srgb, var(--valve-accent) 16%, transparent), inset 0 0 34px color-mix(in srgb, var(--valve-accent) 7%, transparent);
  transition: left .68s cubic-bezier(.16, 1, .3, 1), border-color .35s ease, box-shadow .35s ease;
  pointer-events: none;
}

.valve-stage-markers {
  position: absolute;
  z-index: 5;
  right: 14px;
  bottom: 14px;
  left: 14px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.valve-family-tab {
  position: relative;
  min-width: 0;
  padding: 12px 13px;
  color: #9eb0b2;
  border: 1px solid rgba(190, 215, 211, .12);
  border-radius: 10px;
  background: rgba(6, 20, 27, .76);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-align: left;
  cursor: pointer;
  transition: color .3s ease, border-color .3s ease, background .3s ease, transform .3s ease;
}
.valve-family-tab span {
  display: block;
  margin-bottom: 7px;
  color: color-mix(in srgb, var(--valve-accent) 70%, #fff);
  font: 500 9px/1 var(--font-mono, monospace);
  letter-spacing: .12em;
}
.valve-family-tab strong {
  display: block;
  overflow: hidden;
  font-family: var(--font-display, "Sora", sans-serif);
  font-size: clamp(.78rem, 1.2vw, .98rem);
  font-weight: 600;
  text-overflow: ellipsis;
}
.valve-family-tab:hover,
.valve-family-tab:focus-visible { color: #f0f2ed; border-color: color-mix(in srgb, var(--valve-accent) 38%, transparent); transform: translateY(-3px); }
.valve-family-tab.is-active { color: #f4f4ef; border-color: color-mix(in srgb, var(--valve-accent) 52%, transparent); background: color-mix(in srgb, var(--valve-accent) 13%, rgba(6, 20, 27, .86)); }
.valve-family-tab.is-active::after { content: ""; position: absolute; right: 12px; bottom: 8px; left: 12px; height: 2px; background: var(--valve-accent); box-shadow: 0 0 12px var(--valve-accent); }

.valve-spec-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1.05fr) minmax(430px, 1.7fr) auto;
  align-items: center;
  gap: clamp(22px, 3vw, 42px);
  margin-top: 14px;
  padding: clamp(20px, 2.5vw, 30px);
  border: 1px solid rgba(164, 209, 200, .14);
  border-radius: 18px;
  background: linear-gradient(100deg, rgba(13, 38, 45, .85), rgba(9, 27, 34, .62));
}
.valve-spec-copy > span { color: var(--valve-accent); font-size: 9px; letter-spacing: .12em; }
.valve-spec-copy h4 { margin: 7px 0 7px; color: #f2f2eb; font-family: var(--font-display, "Sora", sans-serif); font-size: clamp(1.25rem, 2vw, 1.75rem); font-weight: 600; letter-spacing: -.025em; }
.valve-spec-copy p { margin: 0; color: #9fb4b6; font-size: .89rem; line-height: 1.58; }
.valve-spec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 28px; margin: 0; }
.valve-spec-grid div { min-width: 0; padding-left: 12px; border-left: 1px solid color-mix(in srgb, var(--valve-accent) 30%, transparent); }
.valve-spec-grid dt { margin-bottom: 5px; color: #829b9e; font: 500 9px/1 var(--font-mono, monospace); letter-spacing: .1em; text-transform: uppercase; }
.valve-spec-grid dd { margin: 0; color: #e5ebe7; font-size: .9rem; font-weight: 600; }

.valve-rfq-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-width: 190px;
  padding: 15px 17px;
  color: #061518;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--valve-accent) 90%, #fff), var(--valve-accent));
  box-shadow: 0 15px 34px color-mix(in srgb, var(--valve-accent) 18%, transparent);
  font: 700 11px/1.2 var(--font-body, sans-serif);
  cursor: pointer;
  transition: transform .3s ease, box-shadow .3s ease;
}
.valve-rfq-button:hover { transform: translateY(-3px); box-shadow: 0 20px 42px color-mix(in srgb, var(--valve-accent) 28%, transparent); }
.valve-rfq-button b { font-size: 17px; }
.valve-action-stack {
  display: grid;
  gap: 9px;
  min-width: 220px;
}
.valve-action-stack .valve-rfq-button { width: 100%; }
.valve-catalogue-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 15px;
  color: #dce8e4;
  border: 1px solid color-mix(in srgb, var(--valve-accent) 28%, transparent);
  border-radius: 10px;
  background: rgba(255, 255, 255, .025);
  text-decoration: none;
  transition: color .3s ease, border-color .3s ease, background .3s ease, transform .3s ease;
}
.valve-catalogue-button span {
  font-family: var(--font-body, sans-serif);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.3;
}
.valve-catalogue-button small {
  display: block;
  margin-bottom: 4px;
  color: #81999b;
  font: 500 8px/1 var(--font-mono, monospace);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.valve-catalogue-button b { color: var(--valve-accent); font-size: 17px; }
.valve-catalogue-button:hover,
.valve-catalogue-button:focus-visible {
  color: #fff;
  border-color: color-mix(in srgb, var(--valve-accent) 55%, transparent);
  background: color-mix(in srgb, var(--valve-accent) 8%, transparent);
  transform: translateY(-2px);
}
.valve-source-note { margin: 16px 0 0; color: #718a8e; font-size: 8px; letter-spacing: .13em; }

html[data-theme="light"] .valve-explorer {
  color: #10272d;
  border-color: rgba(28, 76, 78, .18);
  background: radial-gradient(circle at 88% 8%, rgba(60, 133, 124, .12), transparent 30%), linear-gradient(145deg, rgba(246, 247, 241, .98), rgba(223, 231, 226, .96));
  box-shadow: 0 38px 90px rgba(26, 61, 65, .16), inset 0 1px 0 #fff;
}
html[data-theme="light"] .valve-explorer-head h3,
html[data-theme="light"] .valve-spec-copy h4 { color: #0a252b; }
html[data-theme="light"] .valve-explorer-head p,
html[data-theme="light"] .valve-spec-copy p { color: #4f676b; }

/* The assistant keeps one identity but borrows a restrained accent from the
   section behind it, so it no longer feels pasted onto the website. */
.robot-assistant {
  --robot-accent: #9bd2c7;
  --robot-accent-rgb: 155, 210, 199;
  --robot-surface: rgba(7, 25, 31, .88);
  width: clamp(94px, 7.4vw, 112px);
  filter: none;
}
.robot-assistant[data-context="hero"] { --robot-accent: #d7bc82; --robot-accent-rgb: 215, 188, 130; --robot-surface: rgba(8, 19, 25, .9); }
.robot-assistant[data-context="facilities"] { --robot-accent: #83caba; --robot-accent-rgb: 131, 202, 186; --robot-surface: rgba(7, 29, 34, .9); }
.robot-assistant[data-context="source"] { --robot-accent: #9bd2c7; --robot-accent-rgb: 155, 210, 199; --robot-surface: rgba(8, 29, 35, .9); }
.robot-assistant[data-context="how"] { --robot-accent: #b8a0dc; --robot-accent-rgb: 184, 160, 220; --robot-surface: rgba(18, 22, 39, .9); }
.robot-assistant[data-context="why"] { --robot-accent: #d8a48e; --robot-accent-rgb: 216, 164, 142; --robot-surface: rgba(28, 24, 29, .9); }
.robot-assistant[data-context="reference"] { --robot-accent: #91b9e4; --robot-accent-rgb: 145, 185, 228; --robot-surface: rgba(12, 25, 39, .9); }
.robot-assistant[data-context="faq"] { --robot-accent: #a9c892; --robot-accent-rgb: 169, 200, 146; --robot-surface: rgba(16, 31, 29, .9); }
.robot-assistant[data-context="rfq"] { --robot-accent: #77c9b8; --robot-accent-rgb: 119, 201, 184; --robot-surface: rgba(7, 28, 34, .92); }

.robot-assistant::before {
  display: block !important;
  content: "";
  position: absolute;
  z-index: -1;
  inset: 8px 6px 4px;
  border: 1px solid rgba(var(--robot-accent-rgb), .3);
  border-radius: 28px 28px 36px 36px;
  background:
    radial-gradient(circle at 50% 27%, rgba(var(--robot-accent-rgb), .22), transparent 47%),
    linear-gradient(160deg, rgba(255, 255, 255, .055), var(--robot-surface));
  box-shadow: 0 18px 42px rgba(0, 0, 0, .28), 0 0 28px rgba(var(--robot-accent-rgb), .12), inset 0 1px 0 rgba(255, 255, 255, .07);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  transition: border-color .5s ease, background .5s ease, box-shadow .5s ease;
}
.robot-assistant::after {
  display: block !important;
  content: "RFQ";
  position: absolute;
  z-index: 4;
  right: 12px;
  bottom: 8px;
  padding: 3px 6px;
  color: var(--robot-accent);
  border: 1px solid rgba(var(--robot-accent-rgb), .32);
  border-radius: 999px;
  background: rgba(4, 14, 18, .72);
  font: 600 7px/1 var(--font-mono, monospace);
  letter-spacing: .12em;
}
.robot-video {
  position: relative;
  z-index: 2;
  opacity: .94;
  mix-blend-mode: screen;
  filter: grayscale(.08) saturate(.72) contrast(1.13) brightness(.98) drop-shadow(0 10px 13px rgba(0, 0, 0, .34));
  transition: filter .55s ease, opacity .55s ease;
}
.robot-bubble {
  right: calc(100% + 14px);
  bottom: 8px;
  width: min(258px, calc(100vw - 148px));
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, .28));
}
.robot-bubble-shape {
  padding: 15px 32px 14px 17px;
  border: 1px solid rgba(var(--robot-accent-rgb), .36);
  border-radius: 14px;
  clip-path: none;
  background: linear-gradient(145deg, color-mix(in srgb, var(--robot-surface) 92%, transparent), rgba(8, 25, 31, .82));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .055), 0 0 28px rgba(var(--robot-accent-rgb), .1);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: border-color .5s ease, background .5s ease, box-shadow .5s ease;
}
.robot-bubble-shape::before { display: none; }
.robot-bubble-corner { display: none; }
.robot-bubble-accent {
  width: 58px;
  height: 2px;
  margin-bottom: 9px;
  background: linear-gradient(90deg, var(--robot-accent), transparent);
  opacity: .88;
}
.robot-bubble-text {
  min-height: 0;
  color: #e2ece8;
  font-family: var(--font-body, "Inter", sans-serif);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: .005em;
  text-shadow: none;
}
.robot-bubble-cursor { color: var(--robot-accent); }
.robot-bubble-close {
  top: 8px;
  right: 9px;
  color: var(--robot-accent);
  border: 0;
  background: rgba(var(--robot-accent-rgb), .08);
}
.robot-bubble-tail {
  display: block;
  top: auto;
  right: -6px;
  bottom: 18px;
  width: 13px;
  height: 13px;
  border: 0;
  border-top: 1px solid rgba(var(--robot-accent-rgb), .34);
  border-right: 1px solid rgba(var(--robot-accent-rgb), .34);
  background: var(--robot-surface);
  transform: rotate(45deg);
}

@media (max-width: 980px) {
  .valve-spec-panel { grid-template-columns: 1fr 1.45fr; }
  .valve-action-stack { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
}

@media (max-width: 700px) {
  .valve-explorer { margin-inline: -6px; padding: 17px; border-radius: 20px; }
  .valve-explorer-head { display: block; }
  .valve-explorer-close { margin-top: 18px; }
  .valve-stage { min-height: 430px; }
  .valve-stage-lineup { height: 68%; object-fit: cover; object-position: center; }
  .valve-stage::after { display: none; }
  .valve-stage-markers { grid-template-columns: repeat(5, minmax(68px, 1fr)); overflow-x: auto; padding-bottom: 3px; }
  .valve-family-tab { padding: 11px 9px; }
  .valve-spec-panel { grid-template-columns: 1fr; }
  .valve-spec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .valve-action-stack { grid-column: auto; grid-template-columns: 1fr; }
  .robot-assistant { right: 10px; width: 78px; }
  .robot-bubble { right: 0; bottom: calc(100% + 13px); width: min(218px, calc(100vw - 24px)); }
  .robot-bubble-tail { top: calc(100% - 7px); right: 24px; bottom: auto; transform: rotate(135deg); }
  .robot-bubble-text { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .valve-explorer.is-opening,
  .valve-explorer-pulse { animation: none; }
  .valve-stage-lineup,
  .valve-stage-scan { transition: none; }
}
