/* EMATS articles: loaded only on /articles/ pages, on top of site.css (same black + signal-green palette).
   Three hero looks picked per article in data/articles/<slug>.json -> look.variant:
   scope (oscilloscope trace over circuit art), bench (bench photo in a probe frame), terminal (console window).
   Plus a per-article motif code, so each article looks like its own piece while sharing one template. */

/* ---------- hero ---------- */
.post-hero { position: relative; overflow: hidden; isolation: isolate; padding: clamp(30px, 5vw, 64px) 0 clamp(40px, 6vw, 76px);
  background: radial-gradient(60% 90% at 88% 20%, rgba(34, 224, 122, .12), transparent 60%), var(--black); border-bottom: 1px solid var(--line); }
.post-hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(24px, 5vw, 56px); align-items: center; }
.post-hero h1 { font-size: clamp(1.9rem, 4.6vw, 3.1rem); text-wrap: balance; }
.post-hero .kicker a { color: inherit; text-decoration: none; }
.post-meta { color: var(--muted); font-size: .85rem; margin: 0 0 1.2em; }
.post-motif { position: absolute; z-index: -1; left: -8px; bottom: -.12em; margin: 0; font-size: clamp(90px, 17vw, 230px); line-height: .8; font-weight: 700;
  color: transparent; -webkit-text-stroke: 1.5px rgba(57, 255, 136, .14); white-space: nowrap; pointer-events: none; user-select: none; }
.post-hero-fig { position: relative; }
.post-hero-fig img { width: 100%; height: auto; border-radius: 12px; }

/* oscilloscope trace: a pulse line that sweeps across the figure (off for reduced motion) */
.post-osc { position: absolute; z-index: 2; left: 6%; right: 6%; top: 50%; height: 60px; transform: translateY(-50%); pointer-events: none; opacity: .9;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 60'%3E%3Cpath d='M0 30h120l10-22 12 44 12-38 10 16h236' fill='none' stroke='%2339ff88' stroke-width='2.5'/%3E%3C/svg%3E") center/100% 100% no-repeat;
  filter: drop-shadow(0 0 6px rgba(57, 255, 136, .7)); -webkit-mask: linear-gradient(#000, #000) left / 100% 100% no-repeat; mask: linear-gradient(#000, #000) left / 100% 100% no-repeat; }
.post-bench .post-osc, .post-terminal .post-osc { display: none; }

/* bench: photo in a probe frame with corner brackets */
.post-bench .post-hero-fig { padding: 14px; border: 1px solid var(--trace); border-radius: 16px; background: linear-gradient(160deg, rgba(45, 212, 191, .08), transparent 50%), var(--panel); }
.post-bench .post-hero-fig::before, .post-bench .post-hero-fig::after { content: ""; position: absolute; width: 34px; height: 34px; border: 3px solid var(--neon); }
.post-bench .post-hero-fig::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-radius: 14px 0 0 0; }
.post-bench .post-hero-fig::after { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-radius: 0 0 14px 0; }

/* terminal: the figure sits in a console window */
.post-terminal .post-hero-fig { border: 1px solid var(--trace); border-radius: 12px; overflow: hidden; background: #020503; padding-top: 34px; }
.post-terminal .post-hero-fig::before { content: "emats://bench  ● ● ●"; position: absolute; top: 0; left: 0; right: 0; height: 34px; padding: 0 14px; display: flex; align-items: center;
  font: .75rem var(--mono); color: var(--muted); background: var(--panel); border-bottom: 1px solid var(--line); }
.post-terminal .post-hero-fig img, .post-terminal .post-hero-fig svg { border-radius: 0; border: 0; }

/* ---------- body ---------- */
.post-sheet { padding-top: 0; }
.post-body { max-width: 72ch; }
.post-lead { font-size: clamp(1.08rem, 1.8vw, 1.22rem); color: var(--text) !important; }
.post-answer { margin: 1.4em 0 .4em; padding: 18px 20px; border-radius: 12px; border: 1px solid var(--green); background: linear-gradient(135deg, rgba(57, 255, 136, .12), rgba(34, 211, 238, .04)); box-shadow: var(--glow-green); }
.post-answer p { margin: 0; color: var(--text) !important; }
.post-answer .post-answer-k { color: var(--neon) !important; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: .5em; }
.post-sec { position: relative; margin-top: 2.6em; padding-top: .2em; }
.post-sec h2 { margin-top: 0; }
.post-sec-n { margin: 0 0 .2em; font-size: .78rem; color: var(--cyan); letter-spacing: .2em; }
.post-sec-n::before { content: "[ "; } .post-sec-n::after { content: " ]"; }
.post-pairs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 1em 0; }
.post-pairs > div { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--green); border-radius: 10px; padding: 14px 16px; }
.post-pairs dt { font-weight: 700; color: var(--text); margin-bottom: .3em; }
.post-pairs dd { margin: 0; color: var(--muted); font-size: .95rem; }
.post-steps { list-style: none; padding: 0; margin: 1em 0; border-left: 2px solid var(--trace); }
.post-steps li { position: relative; padding: .55em 0 .55em 3.2em; color: #cfe2d6; }
.post-steps li .mono { position: absolute; left: -1px; top: .5em; transform: translateX(-50%); min-width: 34px; text-align: center; padding: 2px 6px; border-radius: 6px;
  background: var(--green); color: #03140a; font-size: .78rem; font-weight: 700; }
.post-cta { margin: 2.4em 0 0; padding: 22px; border-radius: 12px; background: var(--panel); border: 1px dashed var(--green); }
.post-cta .post-cta-h { font-size: 1.2rem; font-weight: 700; color: var(--text); margin: 0 0 .3em; }
.post-cta .btn-wa { min-width: min(100%, 280px); }

/* side panel: the repair page this article belongs to */
.post-owner .post-owner-art { display: block; margin: 0 0 12px; }
.post-owner-name { font-weight: 700; font-size: 1.05rem; margin: 0 0 .3em; }
.post-owner-name a { color: var(--text); text-decoration: none; }
.post-owner .btn-ghost { width: 100%; margin-top: .6em; }

/* ---------- cards (index + more) ---------- */
.post-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 1.4em; }
.post-card { display: flex; flex-direction: column; background: var(--grad-card); border: 1px solid var(--trace); border-radius: 12px; overflow: hidden; color: var(--text); text-decoration: none;
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease; }
.post-card:hover, .post-card:focus-visible { transform: translateY(-3px); border-color: var(--green); box-shadow: var(--glow-green); }
.post-card-fig { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--black); }
.post-card-fig img, .post-card-fig svg { width: 100%; height: 100%; object-fit: cover; border: 0; border-radius: 0; }
.post-card-body { display: flex; flex-direction: column; gap: .45em; padding: 16px 18px 20px; }
.post-card-body h3 { margin: 0; font-size: 1.12rem; }
.post-card-k { font-size: .72rem; color: var(--teal); letter-spacing: .08em; text-transform: uppercase; }
.post-card-x { color: var(--muted); font-size: .93rem; }
.post-card-more { color: var(--green); font-size: .82rem; }
.post-all { margin-top: 1.4em; }
.post-all a { color: var(--green); }

/* ---------- phones first: 390px is the main view ---------- */
@media (max-width: 960px) {
  .post-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .post-hero-grid { grid-template-columns: 1fr; }
  .post-hero-fig { max-width: 560px; }
  .post-hero-fig img { aspect-ratio: 16 / 10; object-fit: cover; }
  .post-sheet { grid-template-columns: 1fr; }
  .post-owner { position: static; }
}
@media (max-width: 600px) {
  .post-pairs, .post-cards { grid-template-columns: 1fr; }
  .post-hero .cta-row > * { flex: 1 1 100%; }
  .post-motif { font-size: 96px; }
  .post-answer, .post-cta { padding: 16px; }
}
@media (prefers-reduced-motion: no-preference) {
  .post-osc { animation: sweep 3.6s ease-in-out infinite; }
  @keyframes sweep { 0% { -webkit-mask-size: 0% 100%; mask-size: 0% 100%; } 70%, 100% { -webkit-mask-size: 100% 100%; mask-size: 100% 100%; } }
}
@media (prefers-reduced-motion: reduce) { .post-card { transition: none; } }


/* Light-theme retune (11 Nov 2026): article body is light; .post-hero stays navy. */
.post-hero { color: var(--hero-text);
  background: radial-gradient(60% 90% at 88% 20%, rgba(42,168,184,.10), transparent 60%), var(--black); }
.post-meta { color: var(--hero-muted); }
.post-motif { -webkit-text-stroke-color: rgba(61,204,122,.18); }
.post-osc { filter: drop-shadow(0 0 3px rgba(61,204,122,.45)); }
.post-bench .post-hero-fig { background: linear-gradient(160deg, rgba(42,168,184,.08), transparent 50%), var(--hero-panel); border-color: var(--hero-trace); }
.post-bench .post-hero-fig::before, .post-bench .post-hero-fig::after { border-color: var(--signal); }
.post-terminal .post-hero-fig { background: #0e161c; border-color: var(--hero-trace); }
.post-terminal .post-hero-fig::before { color: var(--hero-muted); background: var(--hero-panel); border-bottom-color: var(--hero-line); }

.post-lead { color: var(--text) !important; }
.post-answer { border: 1px solid var(--line); background: var(--paper); box-shadow: var(--shadow); }
.post-answer p { color: var(--text) !important; }
.post-answer .post-answer-k { color: var(--teal) !important; }
.post-sec-n { color: var(--teal); }
.post-pairs > div { background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--green); }
.post-pairs dt { color: var(--text); }
.post-pairs dd { color: var(--muted); }
.post-steps { border-left-color: var(--line); }
.post-steps li { color: var(--text); }
.post-steps li .mono { background: var(--btn-bg); color: var(--btn-fg); }
.post-cta { background: #fff; border: 1px dashed var(--green); }
.post-cta .post-cta-h { color: var(--text); }
.post-owner-name a { color: var(--text); }

.post-card { background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--text); }
.post-card:hover, .post-card:focus-visible { border-color: var(--green); box-shadow: var(--shadow); }
.post-card-fig { background: var(--paper); }
.post-card-k { color: var(--teal); }
.post-card-x { color: var(--muted); }
.post-card-more, .post-all a { color: var(--green); }
