/* Bekito — vulnerability explainers (/security/php/, /security/nodejs/).
 * Loaded after css/security.css and reuses its tokens, top bar, article,
 * scene, FAQ and glossary styles. Only what the explainers add lives here. */

/* ---------- hero ---------- */
.vx-hero .hero-art { height: min(64vh, 560px); }
.vx-hero .kicker b { color: var(--bad); font-weight: 600; }
.vx-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.vx-badge { display: inline-flex; align-items: center; gap: 8px; font: 500 12px/1 var(--f-mono); color: var(--n-fg-2); border: 1px solid var(--n-line); border-radius: 999px; padding: 7px 12px; background: rgba(255,255,255,.03); }
.vx-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--bad); flex: none; }
.vx-badge.ok i { background: var(--ok); }
.vx-badge.warn i { background: var(--warm); }
.hero-tally { position: absolute; left: 0; right: 0; top: 6px; text-align: center; font-family: var(--f-mono); color: var(--n-fg-3); font-size: 12px; letter-spacing: .06em; pointer-events: none; }
.hero-tally b { display: block; font: 800 clamp(34px, 4.4vw, 54px)/1.05 var(--f-latin); color: #fff; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hero-tally b em { font-style: normal; color: var(--bad); }

/* ---------- version checker ---------- */
.vc { margin-top: 26px; background: var(--night); color: var(--n-fg); border-radius: 16px; padding: 18px; position: relative; overflow: hidden; box-shadow: 0 24px 50px -32px rgba(12,27,46,.6); }
.vc::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .3; background: linear-gradient(var(--n-line) 1px, transparent 1px) 0 0 / 28px 28px, linear-gradient(90deg, var(--n-line) 1px, transparent 1px) 0 0 / 28px 28px; }
.vc > * { position: relative; }
.vc-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: 10px; background: rgba(255,255,255,.05); width: max-content; max-width: 100%; }
.vc-tabs button { appearance: none; border: 0; background: none; color: var(--n-fg-2); font: 600 13px var(--f-mono); padding: 7px 12px; border-radius: 8px; cursor: pointer; min-height: 34px; }
.vc-tabs button[aria-selected="true"] { background: var(--n-fg); color: var(--night); }
.vc-tabs button:focus-visible, .vc-input input:focus-visible, .vc-ex button:focus-visible { outline: 2px solid var(--warm); outline-offset: 2px; }
.vc label { display: block; margin-top: 14px; font-size: 14px; color: var(--n-fg-2); }
.vc-input { display: flex; align-items: center; gap: 0; margin-top: 8px; background: #050C16; border: 1px solid var(--n-line); border-radius: 10px; overflow: hidden; }
.vc-input span { flex: none; padding: 0 10px 0 14px; font: 500 14px var(--f-mono); color: var(--ok); }
.vc-input input { flex: 1; min-width: 0; appearance: none; border: 0; background: none; color: #fff; font: 500 16px var(--f-mono); padding: 13px 14px 13px 0; }
.vc-input input::placeholder { color: var(--n-fg-3); }
.vc-ex { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; font-size: 12.5px; color: var(--n-fg-3); align-items: center; }
.vc-ex button { appearance: none; border: 1px solid var(--n-line); background: rgba(255,255,255,.04); color: var(--n-fg-2); font: 500 12px var(--f-mono); padding: 4px 9px; border-radius: 7px; cursor: pointer; }
.vc-ex button:hover { border-color: rgba(232,238,245,.4); color: #fff; }
.vc-out { margin-top: 14px; border-radius: 12px; padding: 14px 16px; border: 1px solid var(--n-line); background: rgba(255,255,255,.04); min-height: 74px; transition: background .3s, border-color .3s; }
.vc-out[data-v="ok"] { background: rgba(111,227,161,.1); border-color: rgba(111,227,161,.55); }
.vc-out[data-v="bad"] { background: rgba(255,122,107,.1); border-color: rgba(255,122,107,.6); }
.vc-out[data-v="eol"] { background: rgba(255,122,107,.16); border-color: var(--bad); }
.vc-out[data-v="warn"] { background: rgba(240,168,104,.1); border-color: rgba(240,168,104,.6); }
.vc-out b { display: flex; align-items: center; gap: 10px; font-size: 16.5px; color: #fff; line-height: 1.5; }
.vc-out b::before { content: ''; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--n-fg-3); }
.vc-out[data-v="ok"] b::before { background: var(--ok); }
.vc-out[data-v="bad"] b::before, .vc-out[data-v="eol"] b::before { background: var(--bad); }
.vc-out[data-v="warn"] b::before { background: var(--warm); }
.vc-out p { margin: 6px 0 0 !important; font-size: 14px !important; line-height: 1.7; color: var(--n-fg-2) !important; }
.vc-out code { font-family: var(--f-mono); font-size: .92em; color: #fff; }
.vc-note { margin-top: 12px !important; font-size: 12.5px !important; color: var(--n-fg-3) !important; line-height: 1.7; }

/* ---------- commands ---------- */
.cmd { margin-top: 14px; background: #0A1626; color: #E8EEF5; border-radius: 12px; display: flex; align-items: flex-start; gap: 10px; padding: 12px 12px 12px 16px; font: 500 14px/1.7 var(--f-mono); }
.cmd pre { margin: 0; flex: 1; min-width: 0; white-space: pre-wrap; word-break: break-all; font: inherit; }
.cmd pre::before { content: '$ '; color: var(--ok); }
.cmd .c { color: rgba(232,238,245,.45); }
.cmd button { flex: none; appearance: none; border: 1px solid rgba(169,204,255,.25); background: rgba(255,255,255,.05); color: rgba(232,238,245,.8); font: 500 11.5px var(--f-mono); border-radius: 7px; padding: 5px 9px; cursor: pointer; }
.cmd button:hover { color: #fff; border-color: rgba(232,238,245,.5); }
.cmd button.done { color: var(--ok); border-color: rgba(111,227,161,.5); }
.sec code, .faq code, .gloss code, .vtable code { font-family: var(--f-mono); font-size: .88em; background: rgba(30,42,55,.07); border-radius: 5px; padding: 1px 5px; word-break: break-word; }

/* ---------- tables (stack into cards on phones; no inner scrollbars) ---------- */
.vtable { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 22px; font-size: 14.5px; line-height: 1.65; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.vtable th, .vtable td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.vtable tr:last-child td { border-bottom: 0; }
.vtable thead th { font: 600 12px var(--f-mono); color: var(--ink-3); letter-spacing: .06em; background: var(--paper); }
.vtable td:first-child { font-weight: 700; }
.vtable .mono { font-size: 13px; }
.sev { display: inline-block; font: 700 11px/1 var(--f-mono); letter-spacing: .06em; border-radius: 6px; padding: 4px 7px; white-space: nowrap; }
.sev.crit { background: var(--red); color: #fff; }
.sev.high { background: rgba(200,68,58,.14); color: var(--red); }
.sev.med { background: rgba(180,95,47,.14); color: var(--ak); }
.sev.low { background: rgba(30,42,55,.08); color: var(--ink-3); }
.sev.ok { background: rgba(47,125,79,.14); color: var(--green); }
@media (max-width: 700px) {
  .vtable, .vtable tbody, .vtable tr, .vtable td { display: block; width: 100%; }
  .vtable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .vtable tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .vtable tr:last-child { border-bottom: 0; }
  .vtable td { border: 0; padding: 4px 14px; }
  .vtable td[data-th]::before { content: attr(data-th); display: block; font: 600 11px var(--f-mono); color: var(--ink-3); letter-spacing: .06em; margin-bottom: 1px; }
}

/* ---------- facts strip ---------- */
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 26px; }
.fact { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.fact b { display: block; font: 800 clamp(24px, 2.8vw, 32px)/1.15 var(--f-latin); color: var(--ink); letter-spacing: -.02em; }
.fact b.r { color: var(--red); } .fact b.g { color: var(--green); }
.fact span { display: block; margin-top: 6px; font-size: 13px; line-height: 1.6; color: var(--ink-3); }
@media (max-width: 860px) { .facts { grid-template-columns: 1fr 1fr; } }

/* ---------- support timeline (which versions still get fixes) ---------- */
.life { margin-top: 26px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 18px 14px; }
.life-rows { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr) 64px; gap: 10px 12px; align-items: center; margin-top: 14px; }
.life-end { font-size: 12px; color: var(--ink-3); }
.life-end.r { color: var(--red); font-weight: 600; }
.life-rows .v { font: 700 14px var(--f-mono); }
.life-track { position: relative; height: 22px; border-radius: 6px; background: rgba(30,42,55,.04); }
.life-bar { position: absolute; top: 0; bottom: 0; border-radius: 6px; display: flex; overflow: hidden; transform-origin: left; transform: scaleX(0); transition: transform 1.1s var(--ease); }
.life.in .life-bar, html:not(.js) .life-bar { transform: scaleX(1); }
.life-bar i { display: block; height: 100%; }
.life-bar .a { background: rgba(47,125,79,.75); }
.life-bar .s { background: rgba(180,95,47,.55); }
.life-bar.dead .s { background: rgba(200,68,58,.22); }
.life-tag { position: absolute; top: 50%; transform: translateY(-50%); font: 600 11px var(--f-mono); white-space: nowrap; color: var(--ink-3); padding-left: 6px; }
.life-now { position: absolute; top: -6px; bottom: -6px; width: 2px; background: var(--red); border-radius: 2px; }
.life-now span { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font: 700 10.5px var(--f-mono); color: var(--red); white-space: nowrap; }
.life-axis { position: relative; height: 18px; margin: 6px 76px 0 52px; font: 500 10.5px var(--f-mono); color: var(--ink-3); }
.life-axis span { position: absolute; transform: translateX(-50%); }
.life-key { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 12.5px; color: var(--ink-3); }
.life-key i { display: inline-block; width: 12px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 1px; }

/* sub-headings inside a section */
.sec h3.sub { font-size: 19px; line-height: 1.5; margin-top: 34px; }
.sec h3.sub + p { margin-top: .6em; }

/* ---------- step list for "what to do" ---------- */
.todo { list-style: none; padding: 0; margin: 24px 0 0; counter-reset: td; display: flex; flex-direction: column; gap: 12px; }
.todo > li { counter-increment: td; position: relative; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px 16px 58px; }
.todo > li::before { content: counter(td); position: absolute; left: 16px; top: 15px; width: 28px; height: 28px; border-radius: 50%; background: var(--ak); color: #fff; font: 700 13px/28px var(--f-mono); text-align: center; }
.todo h3 { font-size: 17px; line-height: 1.5; }
.todo p { margin-top: 6px !important; font-size: 15px; }
.todo ul { margin: 8px 0 0; padding-left: 1.2em; font-size: 14.5px; color: var(--ink-2); line-height: 1.75; }
.todo .when { display: inline-block; margin-left: 8px; font: 600 11px var(--f-mono); color: var(--red); border: 1px solid rgba(200,68,58,.35); border-radius: 6px; padding: 1px 6px; vertical-align: 2px; }
@media (max-width: 520px) { .todo > li { padding: 14px 14px 14px 50px; } .todo > li::before { left: 12px; } }

/* ---------- callouts ---------- */
.note { margin-top: 22px; padding: 16px 18px; border-radius: 12px; background: var(--paper); border: 1px solid rgba(180,95,47,.25); font-size: 15px; line-height: 1.8; color: var(--ink-2); }
.note b:first-child { display: block; font: 600 11.5px var(--f-mono); color: var(--ak); letter-spacing: .12em; margin-bottom: 4px; }
.note.red { background: rgba(200,68,58,.06); border-color: rgba(200,68,58,.3); }
.note.red b:first-child { color: var(--red); }
.note.green { background: rgba(47,125,79,.06); border-color: rgba(47,125,79,.3); }
.note.green b:first-child { color: var(--green); }
.note p { margin-top: 6px !important; font-size: 15px; }

/* ---------- cross-links between explainers / hub ---------- */
.vx-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.vx-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; align-items: center; padding: 16px 18px; border-radius: 14px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: border-color .2s, transform .2s; }
.vx-link:hover { border-color: var(--ak); transform: translateY(-2px); }
.vx-link .k { grid-column: 1 / -1; font: 600 11px var(--f-mono); color: var(--red); letter-spacing: .1em; }
.vx-link b { font-size: 16.5px; line-height: 1.45; }
.vx-link span:not(.k):not(.a) { grid-column: 1; font-size: 13.5px; color: var(--ink-3); line-height: 1.6; }
.vx-link .a { grid-column: 2; grid-row: 2 / span 2; font-size: 20px; color: var(--ak); }
@media (max-width: 680px) { .vx-links { grid-template-columns: 1fr; } }

/* ---------- scene vocabulary for the explainers ---------- */
.mem { fill: rgba(255,255,255,.035); stroke: rgba(169,204,255,.28); stroke-width: 1.4; transition: fill .35s, stroke .35s; }
.mem.fill { fill: rgba(158,197,245,.22); stroke: var(--info); }
.mem.half { fill: rgba(240,168,104,.18); stroke: var(--warm); stroke-dasharray: 4 4; }
.mem.bad { fill: rgba(255,122,107,.26); stroke: var(--bad); }
.mem.ok { fill: rgba(111,227,161,.18); stroke: var(--ok); }
.mem.ghost { fill: none; stroke: rgba(255,122,107,.6); stroke-dasharray: 3 4; }
.wire { fill: none; stroke: rgba(232,238,245,.3); stroke-width: 2; }
.wire.bad { stroke: var(--bad); stroke-dasharray: 6 5; animation: flow 1s linear infinite; }
.wire.ok { stroke: var(--ok); }
.wire.warm { stroke: var(--warm); stroke-dasharray: 6 6; }
.panel { fill: rgba(255,255,255,.04); stroke: var(--n-line); stroke-width: 1.5; }
.panel.hot { fill: rgba(255,122,107,.1); stroke: var(--bad); }
.panel.cool { fill: rgba(111,227,161,.08); stroke: var(--ok); }
.code { fill: var(--n-fg-2); font: 500 12.5px var(--f-mono); }
.code.bad { fill: var(--bad); } .code.ok { fill: var(--ok); } .code.warm { fill: var(--warm); } .code.dim { fill: var(--n-fg-3); }
.code.c { text-anchor: middle; }
.tag rect { fill: var(--bad); }
.tag text { fill: #fff; font: 700 11.5px var(--f-mono); text-anchor: middle; }
.tag.ok rect { fill: var(--ok); } .tag.ok text { fill: var(--night); }
.tag.warm rect { fill: var(--warm); } .tag.warm text { fill: var(--night); }
.shake { animation: shake .45s; transform-box: fill-box; transform-origin: center; }
@keyframes shake { 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.blink { animation: blink 1s infinite; }
.pkg { transition: opacity .4s; }
.pkg rect { fill: rgba(255,255,255,.05); stroke: rgba(169,204,255,.3); stroke-width: 1.4; transition: fill .35s, stroke .35s; }
.pkg text { fill: var(--n-fg-2); font: 500 11.5px var(--f-mono); text-anchor: middle; transition: fill .35s; }
.pkg.bad rect { fill: rgba(255,122,107,.22); stroke: var(--bad); }
.pkg.bad text { fill: #fff; }
.pkg.ok rect { fill: rgba(111,227,161,.14); stroke: var(--ok); }
.loot { transition: opacity .4s; }
