/* ============================================
   EXPLAINERS — animations and charts that make VDI and SLM easy to grasp
   (explain.js).
   Every selector sits under .ex-sec so the VDI/SLM page scopes cannot override it. Charts follow the data-viz rules: thin marks, 4px rounded
   data-ends, 2px surface gaps, recessive grid, hover tooltips, table view.
   ============================================ */

.ex-sec { padding: 100px 0; background: #fff8f1; font-family: var(--font-sans); color: #1a1410; }
.ex-sec .ex-head { max-width: 720px; margin: 0 auto 44px; text-align: center; }
.ex-sec .ex-kicker { display: inline-block; padding: 6px 14px; border-radius: 999px; background: #ffeede; color: #e55510; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.ex-sec .ex-title { margin: 16px 0 10px; font-family: var(--font-serif); font-weight: 400; font-size: clamp(32px, 4vw, 52px); line-height: 1.05; letter-spacing: -.02em; color: #1a1410; }
.ex-sec .ex-title em { font-style: italic; color: #ff6a1f; }
.ex-sec .ex-lead { font-size: 16px; line-height: 1.65; color: #4a3f37; }
.ex-sec .ex-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.ex-sec .ex-card { background: #fff; border: 1px solid rgba(26, 20, 16, .08); border-radius: 22px; padding: 26px 26px 22px; box-shadow: 0 4px 14px rgba(26, 20, 16, .05); min-width: 0; }
.ex-sec .ex-card.wide { grid-column: 1 / -1; }
.ex-sec .ex-card h3 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; color: #1a1410; }
.ex-sec .ex-card .ex-sub { margin-top: 4px; font-size: 13.5px; line-height: 1.55; color: #6f655c; }
.ex-sec .ex-note { margin-top: 12px; font-size: 12px; color: #8a7f74; }

/* ---------- VDI: what travels over the network ---------- */
.ex-sec .ex-wire { display: grid; grid-template-columns: 170px 1fr 190px; align-items: center; gap: 18px; margin-top: 24px; }
.ex-sec .ex-node { text-align: center; font-size: 14px; font-weight: 600; color: #1a1410; }
.ex-sec .ex-node small { display: block; margin-top: 4px; font-size: 12px; font-weight: 400; color: #6f655c; line-height: 1.45; }
.ex-sec .ex-node svg { display: block; margin: 0 auto 10px; width: 100%; max-width: 130px; height: auto; }
.ex-sec .ex-lanes { display: grid; gap: 22px; }
.ex-sec .ex-lane { position: relative; height: 34px; border-radius: 999px; background: #fbf3ea; overflow: hidden; }
.ex-sec .ex-lane span { position: absolute; top: -20px; font-size: 12px; font-weight: 500; color: #4a3f37; white-space: nowrap; }
.ex-sec .ex-lane.up span { left: 12px; }
.ex-sec .ex-lane.down span { right: 12px; }
.ex-sec .ex-lane i { position: absolute; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: #2a78d6; opacity: 0; }
.ex-sec .ex-lane.down i { border-radius: 2px; width: 12px; height: 9px; margin-top: -4.5px; background: #eb6834; }
.ex-sec .ex-lane.up i { animation: ex-right 2.4s linear infinite; }
.ex-sec .ex-lane.down i { animation: ex-left 1.6s linear infinite; }
.ex-sec .ex-lane i:nth-child(3) { animation-delay: .5s; } .ex-sec .ex-lane i:nth-child(4) { animation-delay: 1s; } .ex-sec .ex-lane i:nth-child(5) { animation-delay: 1.5s; }
.ex-sec .ex-lane.down i:nth-child(3) { animation-delay: .27s; } .ex-sec .ex-lane.down i:nth-child(4) { animation-delay: .53s; } .ex-sec .ex-lane.down i:nth-child(5) { animation-delay: .8s; } .ex-sec .ex-lane.down i:nth-child(6) { animation-delay: 1.07s; } .ex-sec .ex-lane.down i:nth-child(7) { animation-delay: 1.33s; }
@keyframes ex-right { 0% { left: -12px; opacity: 0; } 10%, 90% { opacity: 1; } 100% { left: calc(100% + 2px); opacity: 0; } }
@keyframes ex-left { 0% { left: calc(100% + 2px); opacity: 0; } 10%, 90% { opacity: 1; } 100% { left: -14px; opacity: 0; } }
.ex-sec .ex-files { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.ex-sec .ex-files b { display: grid; place-items: center; width: 28px; height: 34px; border-radius: 4px; background: #fff3e8; border: 1.5px solid #1a1410; font-size: 9px; font-weight: 600; }
.ex-sec .ex-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 18px; font-size: 12.5px; color: #4a3f37; }
.ex-sec .ex-legend span { display: inline-flex; align-items: center; gap: 7px; }
.ex-sec .ex-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.ex-sec .ex-legend i.sq { border-radius: 2px; }

/* ---------- Charts ---------- */
.ex-sec .ex-chart { position: relative; margin-top: 18px; }
.ex-sec .ex-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.ex-sec .ex-chart .grid line { stroke: #ece6df; stroke-width: 1; }
.ex-sec .ex-chart .axis text, .ex-sec .ex-chart .tick { font: 500 11.5px var(--font-sans); fill: #8a7f74; }
.ex-sec .ex-chart .lbl { font: 600 13px var(--font-sans); fill: #1a1410; }
.ex-sec .ex-chart .lbl.muted { font-weight: 500; fill: #6f655c; }
.ex-sec .ex-chart .mark { transition: opacity .15s ease; cursor: default; }
.ex-sec .ex-chart:hover .mark:not(:hover) { opacity: .55; }
.ex-sec .ex-chart .grow { transform-box: fill-box; transform-origin: left center; transform: scaleX(0); transition: transform 1.1s cubic-bezier(.22, 1, .36, 1); }
.ex-sec .ex-chart .grow.v { transform-origin: center bottom; transform: scaleY(0); }
.ex-sec .ex-chart.is-on .grow { transform: none; }
.ex-sec .ex-tip {
  position: absolute; z-index: 5; pointer-events: none;
  padding: 8px 11px; border-radius: 10px;
  background: #1a1410; color: #fff; font-size: 12.5px; line-height: 1.45; white-space: nowrap;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
  opacity: 0; transform: translate(-50%, calc(-100% - 10px)); transition: opacity .12s ease;
}
.ex-sec .ex-tip b { font-weight: 600; }
.ex-sec .ex-tip.show { opacity: 1; }
.ex-sec .ex-table { margin-top: 14px; font-size: 13px; }
.ex-sec .ex-table summary { cursor: pointer; color: #e55510; font-weight: 500; }
.ex-sec .ex-table table { width: 100%; margin-top: 10px; border-collapse: collapse; }
.ex-sec .ex-table th, .ex-sec .ex-table td { text-align: left; padding: 7px 4px; border-bottom: 1px solid #ece6df; font-weight: 400; color: #4a3f37; }
.ex-sec .ex-table th { font-weight: 600; color: #1a1410; }
.ex-sec .ex-table td:last-child, .ex-sec .ex-table th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.ex-sec .ex-stat { display: flex; align-items: baseline; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid #ece6df; }
.ex-sec .ex-stat b { font-size: 26px; font-weight: 600; letter-spacing: -.02em; color: #1a1410; }
.ex-sec .ex-stat span { font-size: 13px; color: #6f655c; }

/* ---------- SLM: how an answer is built ---------- */
.ex-sec .ex-steps { display: grid; grid-template-columns: 220px 1fr; gap: 26px; margin-top: 20px; }
.ex-sec .ex-step-list { display: grid; gap: 6px; align-content: start; }
.ex-sec .ex-step-list button {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border: 1px solid transparent; border-radius: 14px;
  background: transparent; text-align: left; cursor: pointer;
  font: 500 14px var(--font-sans); color: #6f655c;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.ex-sec .ex-step-list button b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #f3ece4; color: #6f655c; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.ex-sec .ex-step-list button[aria-current="step"] { background: #fff3e8; border-color: #ffd7b0; color: #1a1410; }
.ex-sec .ex-step-list button[aria-current="step"] b { background: #ff6a1f; color: #fff; }
.ex-sec .ex-step-list button::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: #ff6a1f; }
.ex-sec .ex-step-list button[aria-current="step"]::after { animation: ex-progress var(--dur, 3.2s) linear forwards; }
.ex-sec .ex-steps.paused .ex-step-list button::after { animation-play-state: paused; }
@keyframes ex-progress { to { width: 100%; } }

.ex-sec .ex-stage { position: relative; min-height: 300px; padding: 22px; border-radius: 18px; background: #fbf7f2; border: 1px solid #f0e6db; display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; align-items: start; }
.ex-sec .ex-doc { padding: 16px 18px; border-radius: 12px; background: #fff; border: 1px solid #ece6df; font-size: 13.5px; line-height: 1.7; color: #4a3f37; transition: box-shadow .4s ease; }
.ex-sec .ex-doc h4 { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #8a7f74; margin-bottom: 6px; }
.ex-sec .ex-doc mark { background: transparent; color: inherit; border-radius: 4px; padding: 0 2px; background-image: linear-gradient(rgba(255, 106, 31, .28), rgba(255, 106, 31, .28)); background-repeat: no-repeat; background-size: 0 100%; transition: background-size .9s ease; }
.ex-sec .ex-chat { display: grid; gap: 10px; align-content: start; }
.ex-sec .ex-bubble { max-width: 100%; padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; opacity: 0; transform: translateY(8px); transition: opacity .4s ease, transform .4s ease; }
.ex-sec .ex-bubble.q { justify-self: end; background: #1a1410; color: #fff8f1; border-bottom-right-radius: 4px; }
.ex-sec .ex-bubble.a { background: #fff; border: 1px solid #ece6df; color: #1a1410; border-bottom-left-radius: 4px; }
.ex-sec .ex-src { display: inline-block; margin-top: 8px; padding: 2px 9px; border-radius: 999px; background: #ffe1d3; color: #b23a0c; font: 500 11px var(--font-mono); opacity: 0; transition: opacity .4s ease; }
.ex-sec .ex-review { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #eaf7ef; color: #14532d; font-size: 13px; opacity: 0; transform: translateY(8px); transition: opacity .4s ease, transform .4s ease; }
.ex-sec .ex-review b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #15803d; color: #fff; }
.ex-sec .ex-caption { grid-column: 1 / -1; font-size: 13px; color: #6f655c; min-height: 20px; }
.ex-sec .ex-caption strong { color: #1a1410; }
.ex-sec .ex-stage[data-step] .ex-bubble.q { opacity: 1; transform: none; }
.ex-sec .ex-stage[data-step="2"] .ex-doc, .ex-sec .ex-stage[data-step="3"] .ex-doc, .ex-sec .ex-stage[data-step="4"] .ex-doc, .ex-sec .ex-stage[data-step="5"] .ex-doc { box-shadow: 0 0 0 2px #ffb37a; }
.ex-sec .ex-stage[data-step="2"] mark, .ex-sec .ex-stage[data-step="3"] mark, .ex-sec .ex-stage[data-step="4"] mark, .ex-sec .ex-stage[data-step="5"] mark { background-size: 100% 100%; }
.ex-sec .ex-stage[data-step="3"] .ex-bubble.a, .ex-sec .ex-stage[data-step="4"] .ex-bubble.a, .ex-sec .ex-stage[data-step="5"] .ex-bubble.a { opacity: 1; transform: none; }
.ex-sec .ex-stage[data-step="4"] .ex-src, .ex-sec .ex-stage[data-step="5"] .ex-src { opacity: 1; }
.ex-sec .ex-stage[data-step="5"] .ex-review { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .ex-sec .ex-grid { grid-template-columns: 1fr; }
  .ex-sec .ex-wire { grid-template-columns: 1fr; }
  .ex-sec .ex-lanes { order: 2; margin: 18px 0; }
  .ex-sec .ex-node.ex-server { order: 3; }
  .ex-sec .ex-steps { grid-template-columns: 1fr; }
  .ex-sec .ex-step-list { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .ex-sec .ex-step-list button { flex-direction: column; gap: 4px; padding: 8px 4px; font-size: 11px; text-align: center; }
  .ex-sec .ex-stage { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .ex-sec .ex-lane i { animation: none; opacity: 1; }
  .ex-sec .ex-lane i:nth-child(3) { left: 30%; } .ex-sec .ex-lane i:nth-child(4) { left: 60%; } .ex-sec .ex-lane i:nth-child(2) { left: 5%; }
  .ex-sec .ex-chart .grow { transform: none; transition: none; }
  .ex-sec .ex-step-list button::after { display: none; }
}

/* scoped */
/* Neutralise element rules from the .vdi / .slm page scopes */
.ex-sec details { border: 0; padding: 0; }
.ex-sec table { min-width: 0; font-size: 13px; }
.ex-sec summary { font-weight: 500; }
.ex-sec .ex-card a { color: #e55510; text-decoration: underline; text-underline-offset: 3px; }
.ex-sec .ex-card p, .ex-sec .ex-card h3 { max-width: none; }
/* lane labels sit above the lane; chart text stays at its designed size in wide cards */
.ex-sec .ex-lane { overflow: visible; }
.ex-sec .ex-card.wide .ex-chart svg { max-width: 680px; }
.ex-sec .ex-head { padding: 0 20px; }
