/* ==========================================================================
   Enterprise architecture page: the framework viewer
   --------------------------------------------------------------------------
   Used by state3enterprise/enterprise-architecture.html with js/ea-viewer.js.
   Kept apart from components.css so the page ships without a cache bump on
   the shared stylesheet. Lit = held in STATE3, part = partly, dim = not held.
   ========================================================================== */

:root { --ea-blue: #6C9CF0; --ea-blue-2: #A9C3F7; --ea-ink: #0F1A30; --ea-ink-hi: #16264A; --ea-slate: #334155; }

/* ---------- numbers strip ---------- */
.ea-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--color-border-dark); border: 1px solid var(--color-border-dark); border-radius: 16px; overflow: hidden; margin-bottom: var(--space-10); }
@media (min-width: 900px) { .ea-stats { grid-template-columns: repeat(4, 1fr); } }
.ea-stats div { background: var(--color-primary-light); padding: var(--space-5) var(--space-6); }
.ea-stats b { display: block; font-size: clamp(1.75rem, 3.2vw, 2.5rem); font-weight: 700; letter-spacing: -0.02em; color: #fff; font-variant-numeric: tabular-nums; }
.ea-stats span { font-size: var(--text-sm); color: var(--color-text-light); }

/* ---------- tabs with coverage meters ---------- */
.ea-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); margin-bottom: var(--space-6); }
.ea-tab { text-align: left; border: 1px solid var(--color-border-strong); background: rgba(255,255,255,.02); border-radius: 12px; padding: 14px 16px; cursor: pointer; color: var(--color-text-light); font: inherit; transition: border-color .15s, background .15s; }
.ea-tab:hover { border-color: var(--ea-blue); }
.ea-tab[aria-selected="true"] { border-color: var(--ea-blue); background: var(--ea-ink); color: #fff; box-shadow: 0 0 0 1px var(--ea-blue), 0 0 24px rgba(108,156,240,.25); }
.ea-tab:focus-visible { outline: 2px solid var(--ea-blue); outline-offset: 2px; }
.ea-tab strong { display: block; font-size: var(--text-body); color: #fff; }
.ea-tab small { display: block; margin-top: 2px; font-size: var(--text-xs); }
.ea-meter { display: block; height: 4px; border-radius: 4px; background: var(--ea-slate); margin-top: 10px; overflow: hidden; }
.ea-meter i { display: block; height: 100%; background: var(--ea-blue); border-radius: 4px; }

/* ---------- stage ---------- */
.ea-stage { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-6); align-items: start; }
.ea-stage[hidden] { display: none; }
@media (min-width: 1100px) { .ea-stage { grid-template-columns: minmax(0, 1fr) 340px; } }
.ea-figure { margin: 0; background: var(--color-primary-light); border: 1px solid var(--color-border-dark); border-radius: 16px; padding: 22px; position: relative; overflow: hidden; }
.ea-figure::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(148,163,184,.10) 1px, transparent 1px); background-size: 22px 22px; pointer-events: none; }
.ea-figure > * { position: relative; }
.ea-figure svg { display: block; width: 100%; height: auto; font-family: var(--font-sans); }

/* clickable boxes */
.ea-k { cursor: pointer; outline: none; }
.ea-k rect, .ea-k circle { transition: fill .15s, stroke .15s, filter .15s; }
.lit rect, .lit > circle { fill: var(--ea-ink); stroke: var(--ea-blue); stroke-width: 1.5; }
.lit text { fill: #fff; }
.part rect, .part > circle { fill: #0F172A; stroke: var(--ea-blue); stroke-opacity: .55; stroke-dasharray: 5 4; stroke-width: 1.5; }
.part text { fill: #CBD5E1; }
.dim rect, .dim > circle { fill: #0B1222; stroke: var(--ea-slate); stroke-dasharray: 4 4; stroke-width: 1.5; }
.dim text { fill: #64748B; }
.ea-k:hover rect, .ea-k:hover > circle, .ea-k:focus-visible rect, .ea-k:focus-visible > circle { fill: var(--ea-ink-hi); filter: drop-shadow(0 0 10px rgba(108,156,240,.55)); }
.ea-k.is-on rect, .ea-k.is-on > circle { fill: var(--ea-ink-hi); stroke: #fff; stroke-width: 2; stroke-dasharray: none; filter: drop-shadow(0 0 14px rgba(108,156,240,.7)); }
.ea-k:focus-visible rect, .ea-k:focus-visible > circle { stroke: #fff; stroke-width: 2; }
.t { font-size: 15px; font-weight: 600; text-anchor: middle; }
.s { font-size: 12.5px; text-anchor: middle; }
.lit .s { fill: var(--ea-blue-2); }
.part .s, .dim .s { fill: #94A3B8; }
.head { font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; fill: #94A3B8; text-anchor: middle; }
.side { font-size: 13px; font-weight: 600; fill: #E2E8F0; text-anchor: end; }
.band { fill: rgba(108,156,240,.035); }
.band--alt { fill: rgba(108,156,240,.07); }
.note { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; fill: #64748B; }

/* the trace: one capability followed down to the server and its site */
.trace { fill: none; stroke: var(--ea-blue); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 2 9; opacity: .9; animation: march 1.4s linear infinite; pointer-events: none; }
.trace-dot { fill: #fff; filter: drop-shadow(0 0 6px var(--ea-blue)); pointer-events: none; }
.trace-label { font-size: 12px; fill: var(--ea-blue-2); font-weight: 600; }
.badge circle { fill: var(--ea-blue); stroke: none; }
.badge text { fill: #0A0F1E !important; font-size: 11px; font-weight: 700; text-anchor: middle; }
.tr > rect { animation: step 5s ease-in-out infinite; animation-delay: var(--d); }
@keyframes step {
  0%, 22%, 100% { stroke: var(--ea-blue); filter: none; }
  8% { stroke: #fff; filter: drop-shadow(0 0 12px rgba(108,156,240,.9)); }
}
@keyframes march { to { stroke-dashoffset: -22; } }

/* TOGAF orbit */
.orbit { transform-box: view-box; transform-origin: 450px 340px; animation: orbit 18s linear infinite; pointer-events: none; }
.orbit circle { fill: #fff; filter: drop-shadow(0 0 8px var(--ea-blue)); }
@keyframes orbit { to { transform: rotate(360deg); } }
.ring-arrows path { fill: none; stroke: var(--ea-slate); stroke-width: 1.5; }
.anno { font-size: 13px; fill: var(--ea-blue-2); }

/* reveal on scroll */
.js .ea-reveal .ea-k { opacity: 0; transform: translateY(6px); transition: opacity .5s ease, transform .5s ease; transform-box: fill-box; }
.js .ea-reveal.is-in .ea-k { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .trace, .orbit, .tr > rect { animation: none; }
  .trace-dot-anim { display: none; }
  .js .ea-reveal .ea-k { opacity: 1; transform: none; transition: none; }
}

/* Zachman as a table of buttons */
.zx-wrap { overflow-x: auto; }
.zx { width: 100%; min-width: 720px; border-collapse: separate; border-spacing: 6px; table-layout: fixed; }
.zx th { font-size: 11.5px; font-weight: 600; color: #94A3B8; text-transform: uppercase; letter-spacing: .1em; padding: 4px; }
.zx thead th small { display: block; text-transform: none; letter-spacing: 0; font-weight: 500; color: #64748B; font-size: 11px; margin-top: 2px; }
.zx tbody th { text-align: right; text-transform: none; letter-spacing: 0; color: #E2E8F0; font-size: 13px; width: 112px; }
.zx tbody th small { display: block; color: #64748B; font-weight: 500; font-size: 11px; }
.zx td { padding: 0; height: 66px; }
.zx button { width: 100%; height: 100%; border-radius: 9px; font: inherit; font-size: 12.5px; line-height: 1.3; padding: 6px; cursor: pointer; transition: background .15s, box-shadow .15s, border-color .15s; }
.zx .lit { background: var(--ea-ink); border: 1.5px solid var(--ea-blue); color: #fff; }
.zx .part { background: #0F172A; border: 1.5px dashed rgba(108,156,240,.55); color: #CBD5E1; }
.zx .dim { background: #0B1222; border: 1.5px dashed var(--ea-slate); color: #475569; }
.zx button:hover, .zx button:focus-visible { background: var(--ea-ink-hi); box-shadow: 0 0 14px rgba(108,156,240,.45); outline: none; }
.zx button.is-on { background: var(--ea-ink-hi); border: 2px solid #fff; box-shadow: 0 0 16px rgba(108,156,240,.6); color: #fff; }

.ea-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; font-size: var(--text-xs); color: var(--color-text-light); }
.ea-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ea-dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.ea-dot--lit { background: var(--ea-ink); border: 1.5px solid var(--ea-blue); }
.ea-dot--part { border: 1.5px dashed var(--ea-blue); opacity: .7; }
.ea-dot--dim { border: 1.5px dashed var(--ea-slate); }

/* ---------- detail panel ---------- */
.ea-panel { background: var(--color-primary-light); border: 1px solid var(--color-border-dark); border-radius: 16px; padding: var(--space-6); min-height: 100%; }
@media (min-width: 1100px) { .ea-panel { position: sticky; top: 96px; } }
.ea-panel__head { display: flex; align-items: center; gap: 12px; }
.ea-panel__head img { width: 36px; height: 36px; flex: none; }
.ea-panel h3 { font-size: var(--text-h4); }
.ea-pill { display: inline-block; margin-top: var(--space-3); font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--ea-blue); color: var(--ea-blue-2); }
.ea-pill--part { border-style: dashed; }
.ea-pill--dim { border-color: var(--ea-slate); color: #94A3B8; border-style: dashed; }
.ea-panel p { margin-top: var(--space-3); font-size: var(--text-sm); color: var(--color-text-light); line-height: var(--leading-relaxed); }
.ea-ask { margin-top: var(--space-5); padding: var(--space-4); border-radius: 10px; background: var(--ea-ink); border: 1px solid rgba(108,156,240,.35); }
.ea-ask small { display: block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ea-blue); margin-bottom: 4px; }
.ea-ask q { color: #fff; font-size: var(--text-sm); font-weight: 500; quotes: "\201C" "\201D"; }
.ea-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--space-4); padding: 0; list-style: none; }
.ea-chips li { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,.05); border: 1px solid var(--color-border-strong); color: #CBD5E1; }
.ea-hint { margin-top: var(--space-5) !important; font-size: var(--text-xs) !important; color: #64748B !important; }
.ea-cover { display: flex; flex-direction: column; gap: 2px; margin-top: var(--space-4); }
.ea-cover b { font-size: 2.25rem; line-height: 1.1; color: #fff; letter-spacing: -0.02em; white-space: nowrap; }
.ea-cover span { font-size: var(--text-sm); color: var(--color-text-light); }

@media (max-width: 699px) {
  .ea-tabs { grid-template-columns: 1fr; }
  .ea-figure { overflow-x: auto; }
  .ea-figure svg { min-width: 760px; }
}
.tm-note { margin-top: var(--space-10); font-size: var(--text-xs); color: var(--color-text-muted); max-width: 90ch; }

/* ---------- model diagram: Library, workspaces, consolidation ---------- */
.ws-zone rect { fill: rgba(108,156,240,.035); stroke: rgba(255,255,255,.06); }
.ws-h { font-size: 14px; font-weight: 700; fill: #E2E8F0; letter-spacing: .02em; }
.ws-link { fill: none; stroke: var(--ea-blue); stroke-width: 1.8; stroke-opacity: .8; }
.ws-link--dim { stroke: #64748B; stroke-dasharray: 5 5; stroke-opacity: 1; }
.ws-l { font-size: 12px; fill: var(--ea-blue-2); font-weight: 500; }
.ws-l--dim { fill: #94A3B8; }
.ws-box--main rect { stroke-width: 2.5; }
.ws-notes { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 14px; }
@media (min-width: 900px) { .ws-notes { grid-template-columns: repeat(3, 1fr); gap: 24px; } }
.ws-notes li { font-size: var(--text-sm); line-height: var(--leading-relaxed); color: var(--color-text-light); }
.ws-notes b { color: #fff; font-weight: 600; }
