:root {
  /* Shared palette with the Essential Eight app — keeps the three
     pillars reading as one product. */
  --canvas: #f4f5f9;
  --panel: #ffffff;
  --ink: #0d1220;
  --ink-soft: #5a6480;
  --ink-faint: #8a93ab;
  --line: #e7e9f1;
  --line-soft: #f0f1f7;

  --accent: #4f46e5;
  --accent-2: #7c6cf5;
  --accent-3: #a78bfa;
  --accent-soft: #ecebfe;
  --accent-ink: #4338ca;

  --teal: #0d9488;
  --teal-2: #14b8a6;
  --teal-soft: #dcf2ef;

  --navy: #111729;

  --ok: #0f9d70;
  --ok-soft: #e2f6ee;
  --warn: #c2861f;
  --warn-soft: #f8efd9;
  --bad: #e11d48;
  --bad-soft: #fde7ec;

  --radius: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 1px 3px rgba(20, 28, 60, 0.06);
  --shadow-md: 0 12px 32px rgba(20, 28, 60, 0.10);
  --shadow-lg: 0 24px 64px rgba(20, 28, 60, 0.16);
  --shadow-glow: 0 10px 30px rgba(79, 70, 229, 0.28);

  --serif: "Spectral", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Inter", -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--canvas); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
p { line-height: 1.62; }
.muted { color: var(--ink-soft); font-size: 0.95rem; }
.hidden { display: none !important; }
h1, h2, h3 { font-family: var(--sans); letter-spacing: -0.02em; }

/* ---------- Back link ---------- */
.hub-back {
  position: fixed; top: 14px; left: 14px; z-index: 9999;
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: #fff; text-decoration: none;
  background: rgba(17, 23, 41, 0.55); border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 7px 13px; border-radius: 100px; backdrop-filter: blur(8px);
  transition: border-color .15s, background .15s;
}
.hub-back:hover { background: rgba(17, 23, 41, 0.78); border-color: rgba(255,255,255,0.55); }

/* ---------- Masthead ---------- */
.masthead {
  position: relative; padding: 84px 0 60px; color: #fff; overflow: hidden;
  background:
    radial-gradient(1200px 500px at 78% -10%, rgba(124, 108, 245, 0.55), transparent 60%),
    linear-gradient(160deg, #1a1340 0%, #251a5e 42%, #14193a 100%);
}
.masthead::after {
  content: ""; position: absolute; inset: 0; opacity: 0.5;
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(900px 400px at 70% 0%, #000, transparent 75%);
          mask-image: radial-gradient(900px 400px at 70% 0%, #000, transparent 75%);
  pointer-events: none;
}
.masthead-glow { position: absolute; top: -160px; left: -120px; width: 480px; height: 480px; background: radial-gradient(circle, rgba(20, 184, 166, 0.30) 0%, transparent 70%); pointer-events: none; }
.masthead-inner { position: relative; z-index: 1; }
.kicker { text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.7rem; font-weight: 700; color: #b9aefc; margin: 0 0 18px; }
h1 { font-weight: 800; font-size: 3.2rem; line-height: 1.05; letter-spacing: -0.035em; margin: 0 0 18px; }
.lede { font-size: 1.08rem; line-height: 1.65; color: #cdd2e6; max-width: 640px; margin: 0 0 22px; }
.privacy-note { font-size: 0.84rem; color: #c7f2e3; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.16); display: inline-block; padding: 9px 17px; border-radius: 100px; margin: 0; backdrop-filter: blur(6px); }

main { padding: 36px 24px 90px; }

/* ---------- Mode toggle (segmented pill) ---------- */
.mode-tabs { display: inline-flex; gap: 4px; padding: 5px; background: #ebedf4; border-radius: 14px; margin-bottom: 24px; }
.mode-btn { background: transparent; border: none; cursor: pointer; font-family: var(--sans); font-size: 0.92rem; font-weight: 600; color: var(--ink-soft); padding: 11px 22px; border-radius: 10px; transition: color .15s, background .15s, box-shadow .15s; }
.mode-btn:hover { color: var(--ink); }
.mode-btn.active { color: var(--accent-ink); background: var(--panel); box-shadow: var(--shadow-sm); }

.mode-intro { max-width: 760px; margin: 0 0 26px; }

/* ---------- Buttons ---------- */
.btn { font-family: var(--sans); font-size: 0.92rem; font-weight: 600; padding: 12px 24px; border-radius: var(--radius); border: 1px solid transparent; cursor: pointer; transition: transform .12s, box-shadow .18s, opacity .15s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%); color: #fff; box-shadow: var(--shadow-glow); }
.btn-ghost { background: transparent; border: 1.5px solid var(--line); color: var(--ink-soft); }
.btn-ghost:hover { border-color: var(--accent-2); color: var(--accent-ink); }
.step-label { font-size: 0.85rem; color: var(--ink-soft); font-weight: 600; }

/* ============ EXPLORE MODE ============ */
.explore-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }

/* The wrapping monitoring band */
.wrap-band {
  border: 2px dashed var(--teal); border-radius: var(--radius-xl);
  padding: 14px; background: linear-gradient(180deg, var(--teal-soft) 0%, #fff 22%);
}
.wrap-label {
  width: 100%; display: flex; align-items: center; gap: 10px;
  background: transparent; border: none; cursor: pointer; text-align: left;
  font-family: var(--sans); font-weight: 700; font-size: 0.95rem; color: var(--teal);
  padding: 6px 8px 12px; letter-spacing: -0.01em;
}
.wrap-icon { display: inline-flex; }
.wrap-icon svg { width: 22px; height: 22px; }
.wrap-hint { margin-left: auto; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--teal); opacity: 0.8; }
.wrap-label:hover { color: var(--teal-2); }

.stack-core { display: flex; flex-direction: column; gap: 8px; }

/* Each layer row. Depth toward the data core is shown with a thicker,
   stronger left accent (not margins — those overflowed the wrap band).
   Rows are flex children of a column container, so they stretch to the
   band width automatically; no explicit width is set. */
.layer-row {
  display: flex; align-items: center; gap: 14px; text-align: left;
  background: var(--panel); border: 1.5px solid var(--line);
  border-left: calc(3px + var(--depth) * 2px) solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 18px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.layer-row:hover { border-color: var(--accent-2); box-shadow: var(--shadow-sm); transform: translateX(2px); }
.layer-row.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--shadow-md); }
.layer-icon { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: linear-gradient(140deg, var(--accent-soft), #f3f1ff); color: var(--accent); }
.layer-icon svg { width: 24px; height: 24px; }
.layer-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.layer-name { font-weight: 700; font-size: 1rem; letter-spacing: -0.01em; }
.layer-short { font-size: 0.84rem; color: var(--ink-soft); }
.layer-index { margin-left: auto; font-size: 0.64rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; color: var(--accent); opacity: 0.7; }

/* Detail panel */
.layer-detail, .trace-detail {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 28px;
  position: sticky; top: 18px;
}
.detail-placeholder { text-align: center; color: var(--ink-faint); padding: 40px 10px; }
.placeholder-icon { font-size: 2.4rem; color: var(--accent-3); margin-bottom: 10px; }

.detail-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.detail-icon { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: linear-gradient(140deg, var(--accent-soft), #f3f1ff); color: var(--accent); }
.detail-icon svg { width: 26px; height: 26px; }
.detail-head h3 { margin: 0; font-size: 1.35rem; font-weight: 800; }
.detail-plain { font-size: 0.96rem; color: var(--ink); margin: 0 0 18px; }

.detail-block { margin-bottom: 18px; }
.detail-block:last-child { margin-bottom: 0; }
.detail-block p { margin: 0; font-size: 0.92rem; color: var(--ink-soft); }
.detail-label { display: block; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); margin-bottom: 6px; }
.detail-block.defends { background: var(--bad-soft); border-radius: var(--radius); padding: 14px 16px; }
.detail-block.defends .detail-label { color: var(--bad); }
.detail-block.zt { background: var(--accent-soft); border-radius: var(--radius); padding: 14px 16px; }
.detail-block.zt .detail-label { color: var(--accent-ink); }

.control-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.control-list li { background: var(--line-soft); border-radius: var(--radius); padding: 12px 14px; }
.control-list strong { display: block; font-size: 0.9rem; font-weight: 700; letter-spacing: -0.01em; }
.control-list span { display: block; font-size: 0.82rem; color: var(--ink-soft); margin-top: 2px; }

/* ============ TRACE MODE ============ */
.scenario-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 28px; }
.scenario-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; text-align: left;
  background: var(--panel); border: 1.5px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 22px; cursor: pointer;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.scenario-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--accent-2); }
.scenario-card.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--shadow-md); }
.scenario-icon { width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center; background: linear-gradient(140deg, var(--accent-soft), #f3f1ff); color: var(--accent); }
.scenario-icon svg { width: 26px; height: 26px; }
.scenario-name { font-weight: 800; font-size: 1.05rem; letter-spacing: -0.015em; }
.scenario-summary { font-size: 0.85rem; color: var(--ink-soft); line-height: 1.55; flex: 1; }
.scenario-cta { font-size: 0.84rem; font-weight: 700; color: var(--accent-ink); }

.trace-grid { display: grid; grid-template-columns: 240px 1fr; gap: 24px; align-items: start; margin-bottom: 22px; }

/* Layer rail with active highlight */
.trace-rail { display: flex; flex-direction: column; gap: 8px; position: sticky; top: 18px; }
.rail-node {
  display: flex; align-items: center; gap: 11px;
  background: var(--panel); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; opacity: 0.55; transition: all .3s ease; position: relative;
}
.rail-node .rail-icon { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: var(--line-soft); color: var(--ink-soft); }
.rail-icon svg { width: 18px; height: 18px; }
.rail-name { font-size: 0.86rem; font-weight: 600; }
.rail-node.done { opacity: 1; border-color: var(--line); }
.rail-node.done .rail-icon { background: var(--ok-soft); color: var(--ok); }
.rail-node.active {
  opacity: 1; border-color: var(--accent); background: var(--accent-soft);
  box-shadow: var(--shadow-md); transform: scale(1.03);
}
.rail-node.active .rail-icon { background: linear-gradient(140deg, var(--accent), var(--accent-2)); color: #fff; }
.rail-node.active::before { content: "▸"; position: absolute; left: -16px; color: var(--accent); font-size: 1rem; font-weight: 700; }

/* Step detail */
.step-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.step-layer-icon { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: linear-gradient(140deg, var(--accent-soft), #f3f1ff); color: var(--accent); }
.step-layer-icon svg { width: 26px; height: 26px; }
.step-layer-name { font-size: 0.74rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); }
.step-head h3 { margin: 2px 0 0; font-size: 1.25rem; font-weight: 800; }
.outcome-badge { margin-left: auto; padding: 6px 14px; border-radius: 100px; font-size: 0.76rem; font-weight: 800; white-space: nowrap; align-self: center; }
.out-stops { background: var(--ok-soft); color: var(--ok); }
.out-slows { background: var(--warn-soft); color: var(--warn); }
.out-detects { background: var(--accent-soft); color: var(--accent-ink); }

.step-block { border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px; }
.step-block p { margin: 0; font-size: 0.93rem; line-height: 1.6; }
.step-block.strong { background: var(--ok-soft); }
.step-block.strong .detail-label { color: var(--ok); }
.step-block.weak { background: var(--bad-soft); }
.step-block.weak .detail-label { color: var(--bad); }
.step-block.weak p { color: #8a1530; }
.step-block.zt { background: var(--navy); color: #cdd2e6; }
.zt-mark { display: block; font-family: var(--serif); font-style: italic; font-size: 1.02rem; color: var(--accent-3); margin-bottom: 6px; }

.trace-controls { display: flex; justify-content: space-between; align-items: center; padding-top: 20px; border-top: 1px solid var(--line); }

/* ---------- Kill-chain timeline ---------- */
.kill-chain-wrap {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 20px 22px; margin-bottom: 22px;
}
.kill-chain-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.kill-chain-title { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); }
.kill-chain-scenario { font-size: 0.86rem; font-weight: 600; color: var(--ink-soft); }
.kill-chain { list-style: none; margin: 0; padding: 0; display: flex; gap: 0; align-items: stretch; }
.kc-node { flex: 1; position: relative; display: flex; }
/* connector line between stages */
.kc-node::after {
  content: ""; position: absolute; top: 26px; left: 50%; right: -50%; height: 2px;
  background: var(--line); z-index: 0;
}
.kc-node:last-child::after { display: none; }
.kc-node.done::after { background: var(--accent); }
.kc-btn {
  position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer; padding: 0 4px; text-align: center; font-family: var(--sans);
}
.kc-num {
  width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.82rem; background: var(--panel); color: var(--ink-faint);
  border: 2px solid var(--line); transition: all .2s ease;
}
.kc-node.done .kc-num { background: var(--accent); color: #fff; border-color: var(--accent); }
.kc-node.active .kc-num { background: linear-gradient(140deg, var(--accent), var(--accent-2)); color: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); transform: scale(1.12); }
.kc-phase { font-size: 0.74rem; font-weight: 700; color: var(--ink-soft); line-height: 1.2; }
.kc-node.active .kc-phase { color: var(--accent-ink); }
.kc-attck { font-family: var(--mono); font-size: 0.64rem; color: var(--ink-faint); letter-spacing: 0.02em; }
.kc-btn:hover .kc-num { border-color: var(--accent-2); }

/* ---------- Step head extras ---------- */
.step-head-text { flex: 1; min-width: 0; }
.step-attck { display: inline-block; margin-top: 6px; font-family: var(--mono); font-size: 0.72rem; font-weight: 600; color: var(--accent-ink); background: var(--accent-soft); padding: 3px 9px; border-radius: 6px; letter-spacing: 0.01em; }

/* ---------- Telemetry block (technical) ---------- */
.step-block.telemetry { background: #0f1424; color: #c7d0ea; border: 1px solid #1f2942; }
.step-block.telemetry .detail-label { color: #8b9bd4; }
.telemetry-text { font-family: var(--mono); font-size: 0.84rem !important; line-height: 1.65 !important; color: #c7d0ea; }

@media (max-width: 700px) {
  .kill-chain { flex-direction: column; gap: 4px; }
  .kc-node { flex-direction: row; }
  .kc-node::after { display: none; }
  .kc-btn { flex-direction: row; gap: 10px; text-align: left; justify-content: flex-start; padding: 6px 0; }
  .kc-num { flex: 0 0 auto; }
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 30px 0 60px; }
.site-footer p { font-size: 0.8rem; color: var(--ink-faint); margin: 0; line-height: 1.6; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .explore-grid { grid-template-columns: 1fr; }
  .trace-grid { grid-template-columns: 1fr; }
  .trace-rail { position: static; flex-flow: row wrap; }
  .rail-node { flex: 1 1 140px; }
  .rail-node.active::before { display: none; }
  .layer-detail, .trace-detail { position: static; }
  .scenario-picker { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  h1 { font-size: 2.2rem; }
  .masthead { padding: 64px 0 48px; }
  .layer-row { margin-left: 0 !important; margin-right: 0 !important; }
  .mode-tabs { display: flex; width: 100%; }
  .mode-btn { flex: 1; }
  .trace-controls { flex-direction: column-reverse; gap: 12px; align-items: stretch; }
}
