/* Home page "Ops console" polish (Kris 2026-11-17: look C, with look A's
 * dark-mode depth). Loaded by home.php after cm.css; every page rule is under
 * :where([data-page~="home"]), so it cannot leak to other pages, and it wins
 * over cm.css's equal-specificity home rules by load order.
 *
 * Extends the cm.css tokens (--accent, --accent2, --info, --ok, --warn, --crit,
 * --surface...); no new palette. The portfolio menu bar and aurora backdrop
 * are untouched. Light and dark differ only through the --lk-* variables
 * below: dark gets a deeper elevation scale, tinted stat cards with coloured
 * left rails, and a glow on the primary CTA and the final CTA panel.
 *
 * Contrast: white text sits only on --accent2 (>=5.35:1). The hero console
 * mock follows the theme: light uses the cm.css light text and status tokens
 * on #fff / #f1f5f9, dark uses #dbe4f3 / #93a3c0 on #0f1726 / #162036 (>=6:1).
 * The final CTA panel is a fixed dark ground in both themes.
 * Motion: the console's live dot stops under prefers-reduced-motion and the
 * site's html[data-motion="reduce"]. */

/* ── Tokens: elevation scale + dark-mode depth ────────────────────────── */
:where([data-page~="home"]) {
  --lk-sh: 15 23 42;
  --lk-hl: rgb(255 255 255 / .9);
  --lk-e1: 0 1px 2px rgb(var(--lk-sh) / .06), 0 2px 8px rgb(var(--lk-sh) / .06);
  --lk-e2: 0 1px 2px rgb(var(--lk-sh) / .06), 0 6px 16px rgb(var(--lk-sh) / .08), 0 18px 36px -12px rgb(var(--lk-sh) / .14);
  --lk-e3: 0 2px 4px rgb(var(--lk-sh) / .06), 0 12px 28px rgb(var(--lk-sh) / .10), 0 36px 72px -20px rgb(var(--lk-sh) / .24);
  --lk-stat-tint: 0%; --lk-stat-top: 2px; --lk-stat-left: 1px; --lk-stat-left-mix: 0%;
  --lk-cta-glow: 0 0 0 transparent; --lk-cta-panel-glow: 0 0 0 transparent; --lk-core-depth: 0 0 0 transparent;
  /* Console mock, light: status text tokens pass AA (>=4.5:1) on #fff and #f1f5f9 */
  --lk-con-bg: #ffffff; --lk-con-2: #f1f5f9; --lk-con-line: #e3e8ef; --lk-con-text: #1e293b; --lk-con-muted: #4f5b6e;
  --lk-c-crit: #971818; --lk-c-warn: #784203; --lk-c-ok: #0c5c2a;
  --lk-spark: #1d4ed8; --lk-spark-fill: rgb(29 78 216 / .10);
}
:where(html[data-theme="dark"][data-page~="home"]) {
  --lk-sh: 0 3 10;
  --lk-hl: rgb(255 255 255 / .06);
  --lk-e1: 0 1px 2px rgb(var(--lk-sh) / .45), 0 3px 10px rgb(var(--lk-sh) / .35);
  --lk-e2: 0 1px 2px rgb(var(--lk-sh) / .5), 0 10px 24px rgb(var(--lk-sh) / .45), 0 24px 48px -12px rgb(var(--lk-sh) / .55);
  --lk-e3: 0 0 0 1px rgb(255 255 255 / .04), 0 2px 4px rgb(var(--lk-sh) / .5), 0 18px 36px rgb(var(--lk-sh) / .5), 0 44px 88px -20px rgb(var(--lk-sh) / .7);
  --lk-stat-tint: 12%; --lk-stat-top: 1px; --lk-stat-left: 3px; --lk-stat-left-mix: 100%;
  --lk-cta-glow: 0 0 28px color-mix(in srgb, var(--accent) 35%, transparent);
  --lk-cta-panel-glow: 0 0 80px -10px color-mix(in srgb, var(--accent) 30%, transparent);
  --lk-core-depth: 0 24px 48px rgb(var(--lk-sh) / .6);
  /* Console mock, dark */
  --lk-con-bg: #0f1726; --lk-con-2: #162036; --lk-con-line: #26324a; --lk-con-text: #dbe4f3; --lk-con-muted: #93a3c0;
  --lk-c-crit: #ff9baa; --lk-c-warn: #ffc94d; --lk-c-ok: #34e0a1;
  --lk-spark: #38bdf8; --lk-spark-fill: rgb(56 189 248 / .14);
}
@media (prefers-color-scheme: dark) {
  :where(html:not([data-theme])[data-page~="home"]) {
  --lk-sh: 0 3 10;
  --lk-hl: rgb(255 255 255 / .06);
  --lk-e1: 0 1px 2px rgb(var(--lk-sh) / .45), 0 3px 10px rgb(var(--lk-sh) / .35);
  --lk-e2: 0 1px 2px rgb(var(--lk-sh) / .5), 0 10px 24px rgb(var(--lk-sh) / .45), 0 24px 48px -12px rgb(var(--lk-sh) / .55);
  --lk-e3: 0 0 0 1px rgb(255 255 255 / .04), 0 2px 4px rgb(var(--lk-sh) / .5), 0 18px 36px rgb(var(--lk-sh) / .5), 0 44px 88px -20px rgb(var(--lk-sh) / .7);
  --lk-stat-tint: 12%; --lk-stat-top: 1px; --lk-stat-left: 3px; --lk-stat-left-mix: 100%;
  --lk-cta-glow: 0 0 28px color-mix(in srgb, var(--accent) 35%, transparent);
  --lk-cta-panel-glow: 0 0 80px -10px color-mix(in srgb, var(--accent) 30%, transparent);
  --lk-core-depth: 0 24px 48px rgb(var(--lk-sh) / .6);
  /* Console mock, dark */
  --lk-con-bg: #0f1726; --lk-con-2: #162036; --lk-con-line: #26324a; --lk-con-text: #dbe4f3; --lk-con-muted: #93a3c0;
  --lk-c-crit: #ff9baa; --lk-c-warn: #ffc94d; --lk-c-ok: #34e0a1;
  --lk-spark: #38bdf8; --lk-spark-fill: rgb(56 189 248 / .14);
  }
}

/* Primary CTA: inset highlight + coloured drop; glows in dark */
:where([data-page~="home"]) .btn-primary,
:where([data-page~="home"]) .price-btn-primary {
  background: linear-gradient(180deg, var(--accent2), color-mix(in srgb, var(--accent2) 82%, #000));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .22), 0 1px 2px rgb(var(--lk-sh) / .2), 0 8px 20px -6px color-mix(in srgb, var(--accent2) 60%, transparent), var(--lk-cta-glow);
}
:where([data-page~="home"]) .btn-primary:hover,
:where([data-page~="home"]) .price-btn-primary:hover {
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .22), 0 2px 4px rgb(var(--lk-sh) / .2), 0 14px 28px -8px color-mix(in srgb, var(--accent2) 70%, transparent), var(--lk-cta-glow);
}

/* ── Hero layout, console mock and cards ──────────────────────────────── */
:where([data-page~="home"]) .hero-inner { grid-template-areas: "copy radar" "copy console"; row-gap: 0; }
:where([data-page~="home"]) .hero-copy { grid-area: copy; }
:where([data-page~="home"]) .cov-radar { grid-area: radar; max-width: 430px; filter: drop-shadow(0 20px 36px rgb(var(--lk-sh) / .14)); }
:where([data-page~="home"]) .lk-console { grid-area: console; }
:where([data-page~="home"]) .hero-glow { background: radial-gradient(circle, color-mix(in srgb, var(--ok) 10%, transparent) 0%, color-mix(in srgb, var(--accent2) 10%, transparent) 35%, transparent 70%); top: 55%; }
:where([data-page~="home"]) .cov-node { box-shadow: var(--lk-e2); }
:where([data-page~="home"]) .cov-core { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 6%, transparent), 0 0 48px color-mix(in srgb, var(--accent) 22%, transparent), var(--lk-core-depth); }
.lk-console {
  width: 100%; max-width: 460px; justify-self: center; margin-top: 18px; position: relative; z-index: 4;
  background: var(--lk-con-bg); color: var(--lk-con-text); border-radius: 14px; overflow: hidden;
  border: 1px solid var(--lk-con-line);
  box-shadow: var(--lk-e3), 0 0 0 1px rgb(255 255 255 / .03) inset, 0 30px 60px -30px color-mix(in srgb, var(--accent2) 50%, transparent);
  font-family: var(--font-mono); font-size: .74rem;
}
.lk-console-bar { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--lk-con-2); border-bottom: 1px solid var(--lk-con-line); }
.lk-dots { display: inline-flex; gap: 5px; }
.lk-dots i { width: 9px; height: 9px; border-radius: 50%; background: #3a4660; }
.lk-dots i:nth-child(1) { background: #f87171; } .lk-dots i:nth-child(2) { background: #fbbf24; } .lk-dots i:nth-child(3) { background: #34d399; }
.lk-console-title { color: var(--lk-con-muted); flex: 1; }
.lk-console-live { display: inline-flex; align-items: center; gap: 6px; color: var(--lk-c-ok); }
.lk-live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lk-c-ok); box-shadow: 0 0 8px var(--lk-c-ok); animation: live-pulse 1.8s ease-in-out infinite; }
.lk-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 12px 4px; }
.lk-kpi { background: var(--lk-con-2); border: 1px solid var(--lk-con-line); border-top: 2px solid var(--lk-k); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; }
.lk-kpi b { font-size: 1.25rem; color: var(--lk-k); font-weight: 600; line-height: 1.1; }
.lk-kpi span { color: var(--lk-con-muted); font-size: .66rem; }
.lk-crit { --lk-k: var(--lk-c-crit); } .lk-warn { --lk-k: var(--lk-c-warn); } .lk-ok { --lk-k: var(--lk-c-ok); }
.lk-spark { display: block; width: calc(100% - 24px); height: 40px; margin: 6px 12px 2px; }
.lk-spark-line { fill: none; stroke: var(--lk-spark); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.lk-spark-area { fill: var(--lk-spark-fill); }
.lk-alerts { list-style: none; margin: 0; padding: 6px 12px 12px; display: grid; gap: 6px; }
.lk-alerts li { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; background: var(--lk-con-2); border-left: 2px solid var(--lk-k); }
.lk-sev { width: 8px; height: 8px; border-radius: 50%; background: var(--lk-k); box-shadow: 0 0 6px var(--lk-k); }
.lk-res { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--lk-con-text); }
.lk-msg { color: var(--lk-k); white-space: nowrap; }

:where([data-page~="home"]) .hero-stats { gap: 10px; }
:where([data-page~="home"]) .hero-stat {
  background: color-mix(in srgb, var(--lk-k) var(--lk-stat-tint), var(--surface)); border: 1px solid var(--border);
  border-top: var(--lk-stat-top) solid var(--lk-k); border-left: var(--lk-stat-left) solid color-mix(in srgb, var(--lk-k) var(--lk-stat-left-mix), var(--border));
  border-radius: 10px; padding: 10px 16px; box-shadow: var(--lk-e2), inset 0 1px 0 var(--lk-hl);
}
:where([data-page~="home"]) .hero-stat:nth-child(1) { --lk-k: var(--ok); }
:where([data-page~="home"]) .hero-stat:nth-child(2) { --lk-k: var(--accent2-line); }
:where([data-page~="home"]) .hero-stat:nth-child(3) { --lk-k: var(--info); }
:where([data-page~="home"]) .hero-stat-val { font-size: 1.3rem; color: var(--text); }
:where([data-page~="home"]) .btn { border-radius: 8px; }
:where([data-page~="home"]) .btn-outline { background: var(--surface); box-shadow: var(--lk-e1); }
:where([data-page~="home"]) .section-eyebrow::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); margin-right: 8px; vertical-align: 1px; }
/* deep-elevation solid cards with a status rail */
:where([data-page~="home"]) .feature-card,
:where([data-page~="home"]) .price-card,
:where([data-page~="home"]) .problem-item,
:where([data-page~="home"]) .cov-row {
  --lk-k: var(--accent2-line);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--lk-e3), inset 0 1px 0 var(--lk-hl);
}
:where([data-page~="home"]) .feature-card { border-left: 3px solid var(--lk-k); border-radius: 10px; }
:where([data-page~="home"]) .feature-card:nth-child(5n+1) { --lk-k: var(--crit); }
:where([data-page~="home"]) .feature-card:nth-child(5n+2) { --lk-k: var(--warn); }
:where([data-page~="home"]) .feature-card:nth-child(5n+3) { --lk-k: var(--ok); }
:where([data-page~="home"]) .feature-card:nth-child(5n+4) { --lk-k: var(--info); }
:where([data-page~="home"]) .feature-card::before { display: none; }
:where([data-page~="home"]) .feature-card:hover { transform: translateY(-3px); }
:where([data-page~="home"]) .feature-icon {
  width: 42px; height: 42px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; color: var(--lk-k);
  background: color-mix(in srgb, var(--lk-k) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--lk-k) 30%, var(--border));
}
:where([data-page~="home"]) .feature-tag { color: var(--text); background: var(--surface2); border-color: var(--border2); }
:where([data-page~="home"]) .problem-strip { background: transparent; border: 0; }
:where([data-page~="home"]) .problem-item { border-radius: 10px; padding: 16px; border-left: 3px solid var(--lk-k); }
:where([data-page~="home"]) .problem-item:nth-child(1) { --lk-k: var(--crit); }
:where([data-page~="home"]) .problem-item:nth-child(2) { --lk-k: var(--warn); }
:where([data-page~="home"]) .problem-item:nth-child(3) { --lk-k: var(--info); }
:where([data-page~="home"]) .problem-title { color: var(--lk-k); }
:where([data-page~="home"]) .price-card { border-radius: 10px; border-top: 3px solid var(--border2); }
:where([data-page~="home"]) .price-card.featured { border-top-color: var(--accent2-line); background: var(--surface); box-shadow: var(--lk-e3), 0 0 0 1px var(--accent2-line), 0 24px 48px -20px color-mix(in srgb, var(--accent2) 50%, transparent); }
:where([data-page~="home"]) .price-val { font-family: var(--font-mono); }
:where([data-page~="home"]) .step-num { border-radius: 12px; background: var(--surface); box-shadow: var(--lk-e2); }
:where([data-page~="home"]) .steps .step:nth-child(1) .step-num { border-color: var(--accent2-line); }
:where([data-page~="home"]) .steps .step:nth-child(2) .step-num { border-color: var(--info); color: var(--info); }
:where([data-page~="home"]) .steps .step:nth-child(3) .step-num { border-color: var(--ok); color: var(--ok); }
:where([data-page~="home"]) .quote-section { max-width: 900px; margin: 24px auto; border-radius: 14px; border: 1px solid var(--border); box-shadow: var(--lk-e3); }
/* Final CTA as a console panel: always the dark console ground */
:where([data-page~="home"]) .cta-section {
  --text: #dbe4f3; --muted: #93a3c0; --accent: #38bdf8; --border2: #3a4660; --surface: #162036;
  color: var(--text); max-width: 1000px; margin: 56px auto; border-radius: 18px; border: 1px solid #26324a;
  background:
    linear-gradient(rgb(255 255 255 / .03) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, rgb(255 255 255 / .03) 1px, transparent 1px) 0 0 / 32px 32px,
    radial-gradient(ellipse 60% 80% at 100% 0%, rgb(56 189 248 / .18), transparent 70%),
    #0f1726;
  box-shadow: var(--lk-e3), var(--lk-cta-panel-glow);
}
:where([data-page~="home"]) .cta-section .btn-outline { color: var(--text); }
@media (max-width: 960px) {
  :where([data-page~="home"]) .hero-inner { grid-template-areas: "copy" "radar" "console"; row-gap: 32px; }
  .lk-console { margin-top: 0; }
}
@media (max-width: 768px) {
  :where([data-page~="home"]) .quote-section, :where([data-page~="home"]) .cta-section { margin-left: 16px; margin-right: 16px; }
}


/* ── Motion off: OS setting or the site's own preference ─────────────── */
@media (prefers-reduced-motion: reduce) {
  .lk-live-dot { animation: none; }
  :where([data-page~="home"]) .feature-card, :where([data-page~="home"]) .price-card { transition: none; }
}
html[data-motion="reduce"] .lk-live-dot { animation: none; }
