/* ═══════════════════════════════════════════════════
   West Computers: interactive service model ("wcsm")
   Embeddable section. Needs west-computers.css first
   (uses its :root variables). Markup: see
   _mockups/how-it-works/EMBED.md
   ═══════════════════════════════════════════════════ */

.wcsm {
  --l1: #00C2FF;           /* protection  : brand accent   */
  --l2: #0EA5E9;           /* 24/7 SOC    : accent2        */
  --l3: #7CC9C9;           /* support     : spectra teal   */
  --l4: #F2B544;           /* governance  : warm amber     */
  --wcsm-ink: #0A0F1E;
  --wcsm-bg: var(--navy);
  position: relative;
  padding: clamp(56px, 8vw, 96px) 0;
  background: var(--wcsm-bg);
  scroll-margin-top: 64px;
}
.wcsm--alt { --wcsm-bg: var(--navy2); }
.wcsm-more { margin-top: 28px; }
.wcsm-more a { display: inline-block; padding: 8px 0; font-size: 15px; font-weight: 500; color: var(--accent); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(0,194,255,.4); }
.wcsm-more a:hover { text-decoration-color: var(--accent); }
.wcsm-more a:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.wcsm-head { max-width: 640px; margin-bottom: clamp(28px, 4vw, 44px); }
.wcsm-head h2 {
  font-size: clamp(1.6rem, 3vw, 2.25rem); font-weight: 600;
  letter-spacing: -0.025em; line-height: 1.2; margin-bottom: 12px;
}
.wcsm-head p { color: var(--muted); font-size: 16px; line-height: 1.65; }

.wcsm-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}

/* ── Figure ── */
.wcsm-figure { position: relative; }
.wcsm-stage { position: relative; width: 100%; max-width: 620px; margin: 0 auto; aspect-ratio: 1 / 1; }
.wcsm-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.wcsm-svg text { font-family: var(--sans); pointer-events: none; }

.wcsm-seg { cursor: pointer; outline: none; }
.wcsm-seg path.wcsm-arc {
  fill: var(--seg-fill);
  stroke: var(--wcsm-bg); stroke-width: 3;
  transition: fill .2s ease-out, opacity .2s ease-out;
}
.wcsm-seg[data-layer="1"] { --seg: var(--l1); --seg-fill: rgba(0,194,255,.16); }
.wcsm-seg[data-layer="2"] { --seg: var(--l2); --seg-fill: rgba(14,165,233,.24); }
.wcsm-seg[data-layer="3"] { --seg: var(--l3); --seg-fill: rgba(124,201,201,.18); }
.wcsm-seg[data-layer="4"] { --seg: var(--l4); --seg-fill: rgba(242,181,68,.15); }
.wcsm-seg text { fill: var(--text); font-weight: 500; transition: fill .2s ease-out; }
.wcsm-seg path.wcsm-edge { fill: none; stroke: var(--seg); stroke-width: 2; opacity: .55; transition: opacity .2s ease-out; }

.wcsm-seg:hover path.wcsm-arc,
.wcsm-seg.is-active path.wcsm-arc { fill: var(--seg); }
.wcsm-seg:hover text,
.wcsm-seg.is-active text { fill: var(--wcsm-ink); font-weight: 600; }
.wcsm-seg:hover path.wcsm-edge,
.wcsm-seg.is-active path.wcsm-edge { opacity: 1; }

/* dim everything that isn't part of the current focus */
.wcsm.is-focusing .wcsm-seg:not(.is-active):not(.is-match) { opacity: .26; }
.wcsm-seg { transition: opacity .2s ease-out; }
.wcsm-seg.is-match path.wcsm-arc { fill: color-mix(in srgb, var(--seg) 55%, transparent); }
.wcsm-seg.is-match path.wcsm-edge { opacity: 1; }

/* keyboard focus: a bright outline drawn on the arc itself */
.wcsm-seg:focus-visible path.wcsm-arc { stroke: #fff; stroke-width: 5; }
.wcsm-seg:focus-visible { opacity: 1 !important; }

.wcsm-signal text { fill: var(--muted); font-family: var(--mono); font-size: 17px; letter-spacing: .02em; }
.wcsm-signal path { stroke: rgba(148,163,184,.55); stroke-width: 1.5; fill: none; }
.wcsm-ringlabel { fill: var(--muted); font-family: var(--mono) !important; font-size: 12px; letter-spacing: .14em; }

/* center readout sits over the SVG */
.wcsm-center {
  position: absolute; left: 50%; top: 50%;
  width: 31%; transform: translate(-50%, -50%);
  text-align: center; pointer-events: none;
}
.wcsm-center-kicker { display: block; font-family: var(--mono); font-size: 11px; color: var(--accent); letter-spacing: .06em; margin-bottom: 6px; }
.wcsm-center-name { display: block; font-size: clamp(16px, 1.6vw, 21px); font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; color: var(--text); }
.wcsm-center-tag { display: block; margin-top: 6px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.wcsm-center.is-swapping > * { opacity: 0; }
.wcsm-center > * { transition: opacity .15s ease-out; }

.wcsm-caption { margin-top: 14px; text-align: center; font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* ── Side panel ── */
.wcsm-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.wcsm-tab {
  font: 500 14px/1 var(--sans); color: var(--text);
  background: transparent; border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px; padding: 11px 15px; min-height: 44px; cursor: pointer;
  transition: background-color .15s ease-out, border-color .15s ease-out, color .15s ease-out;
}
.wcsm-tab:hover { border-color: rgba(0,194,255,.5); }
.wcsm-tab[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--wcsm-ink); font-weight: 600; }
.wcsm-tab:focus-visible, .wcsm-layer-btn:focus-visible, .wcsm-detail a:focus-visible, .wcsm-match a:focus-visible, .wcsm-svc a:focus-visible {
  outline: 2px solid #fff; outline-offset: 3px;
}

.wcsm-panel { padding: 22px 22px 18px; background: var(--panel); border-radius: var(--radius); }
.wcsm-panel h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 8px; }
.wcsm-panel p { color: var(--muted); font-size: 15px; line-height: 1.65; }
.wcsm-match { list-style: none; margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.wcsm-match a { font-size: 14px; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(0,194,255,.4); }
.wcsm-match a:hover { text-decoration-color: var(--accent); }

.wcsm-detail { margin-top: 16px; padding: 20px 22px; border: 1px solid var(--border); border-radius: var(--radius); min-height: 196px; }
.wcsm-detail-kicker { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.wcsm-detail-kicker b { color: var(--dl, var(--accent)); font-weight: 400; }
.wcsm-detail h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; margin-bottom: 4px; }
.wcsm-detail .wcsm-d-tag { color: var(--text); font-size: 15px; margin-bottom: 8px; }
.wcsm-detail .wcsm-d-body { color: var(--muted); font-size: 15px; line-height: 1.6; }
.wcsm-detail .wcsm-d-price { margin-top: 10px; font-family: var(--mono); font-size: 13px; color: var(--text); }
.wcsm-detail .wcsm-d-link { display: inline-block; margin-top: 12px; font-size: 15px; font-weight: 500; color: var(--accent); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(0,194,255,.4); }
.wcsm-detail .wcsm-d-link:hover { text-decoration-color: var(--accent); }
.wcsm-detail-empty { color: var(--muted); font-size: 15px; }

/* ── Layers: legend on desktop, accordion on mobile ── */
.wcsm-layers { list-style: none; margin-top: clamp(32px, 4vw, 48px); display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid var(--border); }
.wcsm-layer { padding: 18px 18px 0 0; }
.wcsm-layer + .wcsm-layer { padding-left: 18px; border-left: 1px solid var(--border); }
.wcsm-layer details > summary { list-style: none; cursor: pointer; }
.wcsm-layer details > summary::-webkit-details-marker { display: none; }
.wcsm-layer-btn { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: baseline; border-radius: 6px; padding: 4px 2px; }
.wcsm-layer-num {
  grid-row: span 2; width: 30px; height: 30px; border-radius: 50%;
  display: inline-grid; place-items: center;
  font-family: var(--mono); font-size: 13px; color: var(--wcsm-ink); background: var(--lc);
}
.wcsm-layer[data-layer="1"] { --lc: var(--l1); }
.wcsm-layer[data-layer="2"] { --lc: var(--l2); }
.wcsm-layer[data-layer="3"] { --lc: var(--l3); }
.wcsm-layer[data-layer="4"] { --lc: var(--l4); }
.wcsm-layer h3 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.wcsm-layer-sub { font-size: 14px; color: var(--muted); line-height: 1.5; }
.wcsm-layer.is-lit .wcsm-layer-btn h3 { color: var(--lc); }
.wcsm-services { display: none; }

@media (min-width: 701px) {
  .wcsm-mobile-only { display: none !important; }
}

/* ── Mobile: diagram becomes a stacked accordion ── */
@media (max-width: 700px) {
  .wcsm-grid { grid-template-columns: 1fr; }
  .wcsm-figure, .wcsm-detail { display: none; }
  .wcsm-layers { grid-template-columns: 1fr; border-top: 0; margin-top: 22px; gap: 10px; }
  .wcsm-layer, .wcsm-layer + .wcsm-layer { padding: 0; border-left: 0; }
  .wcsm-layer details { background: var(--panel); border-radius: var(--radius); }
  .wcsm-layer-btn { padding: 14px 44px 14px 14px; min-height: 56px; position: relative; }
  .wcsm-layer-btn::after {
    content: ""; position: absolute; right: 18px; top: 50%; width: 9px; height: 9px;
    border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
    transform: translateY(-70%) rotate(45deg); transition: transform .2s ease-out;
  }
  .wcsm-layer details[open] .wcsm-layer-btn::after { transform: translateY(-30%) rotate(-135deg); }
  .wcsm-services { display: block; list-style: none; padding: 0 14px 8px; }
  .wcsm-svc { padding: 14px 0; border-top: 1px solid var(--border); transition: opacity .2s ease-out; }
  .wcsm-svc h4 { font-size: 16px; font-weight: 600; }
  .wcsm-svc-tag { color: var(--text); font-size: 15px; margin-top: 2px; }
  .wcsm-svc-detail { color: var(--muted); font-size: 15px; line-height: 1.6; margin-top: 4px; }
  .wcsm-svc-price { font-family: var(--mono); font-size: 13px; margin-top: 6px; }
  .wcsm-svc a { display: inline-block; margin-top: 8px; padding: 6px 0; color: var(--accent); font-size: 15px; text-decoration: underline; text-underline-offset: 4px; }
  .wcsm.is-focusing .wcsm-svc:not(.is-match) { opacity: .4; }
  .wcsm-svc.is-match h4 { color: var(--lc); }
  .wcsm-tab { padding: 10px 13px; font-size: 14px; }
}

/* entrance: rings open out from the centre once */
@media (prefers-reduced-motion: no-preference) {
  .wcsm-svg .wcsm-ring { transform-origin: 450px 450px; transform-box: view-box; }
  .wcsm.is-ready:not(.has-entered) .wcsm-ring { opacity: 0; transform: scale(.86); }
  .wcsm.has-entered .wcsm-ring {
    opacity: 1; transform: none;
    transition: opacity .5s ease-out, transform .6s cubic-bezier(.2,.7,.2,1);
    transition-delay: calc(var(--i, 0) * 110ms);
  }
}
@media (prefers-reduced-motion: reduce) {
  .wcsm *, .wcsm *::after { transition: none !important; animation: none !important; }
}
