/* ===== Mask Engine · brand tokens ===== */
:root {
  --bg: #08070d;
  --surface: #11101a;
  --surface-2: #1a1826;
  --line: #28253a;
  --line-soft: #1d1b2c;
  --text: #ece9f2;
  --muted: #8a8699;
  --dim: #5a566a;

  --mask: #9d6fff;
  --mask-glow: rgba(157, 111, 255, 0.32);
  --suppress: #e44a6c;
  --suppress-glow: rgba(228, 74, 108, 0.28);
  --charisma: #f5c14a;
  --charisma-glow: rgba(245, 193, 74, 0.28);
  --hidden: #5ce8f0;
  --hidden-glow: rgba(92, 232, 240, 0.28);
  --defense: #ff9b3d;
  --defense-glow: rgba(255, 155, 61, 0.28);
  --rose: #ff6b9d;

  --primary: var(--mask);
  --primary-glow: var(--mask-glow);

  --display: 'Fraunces', 'Noto Serif SC', serif;
  --body: 'Manrope', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --cjk-display: 'Noto Serif SC', 'Fraunces', serif;
  --cjk-body: 'Noto Sans SC', 'Manrope', sans-serif;
}

[data-theme="light"] {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #efece4;
  --line: #d8d3c8;
  --line-soft: #e8e4d9;
  --text: #1c1a26;
  --muted: #5e5b6e;
  --dim: #9a96aa;

  --mask: #6939e0;
  --mask-glow: rgba(105, 57, 224, 0.18);
  --suppress: #c12d4f;
  --charisma: #b8862a;
  --hidden: #1aa3ad;
  --defense: #c46a14;
  --rose: #c4427a;

  --primary: var(--mask);
  --primary-glow: var(--mask-glow);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
  overflow-x: hidden;
}

html[data-lang="en"] [lang="zh"] { display: none; }
html[data-lang="zh"] [lang="en"] { display: none; }
html[data-lang="zh"] body { font-family: var(--cjk-body); }
html[data-lang="zh"] h1, html[data-lang="zh"] h2, html[data-lang="zh"] h3,
html[data-lang="zh"] .display { font-family: var(--cjk-display); }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ===== nav ===== */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner {
  display: flex; align-items: center; gap: 28px;
  padding: 14px 24px; max-width: 1180px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; }
.brand-mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: radial-gradient(circle at 30% 25%, var(--mask) 0%, #4a2db8 75%);
  display: grid; place-items: center;
  box-shadow: 0 0 16px var(--mask-glow), inset 0 0 8px rgba(255,255,255,0.18);
}
.brand-mark svg { width: 70%; height: 70%; }
.brand-name { font-size: 17px; letter-spacing: 0.02em; }
.brand-name .zh { letter-spacing: 0.05em; }
.nav-links { display: flex; gap: 18px; margin-left: auto; font-size: 13px; color: var(--muted); }
.nav-links a:hover { color: var(--text); }
.nav-ctrl { display: flex; gap: 6px; }
.btn {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 7px 12px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn:hover { color: var(--text); border-color: var(--mask); }
.btn.active { color: var(--text); border-color: var(--mask); background: var(--mask-glow); }

/* ===== hero ===== */
.hero {
  position: relative;
  padding: 100px 0 80px;
  overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(60% 40% at 20% 30%, var(--mask-glow), transparent 70%),
    radial-gradient(50% 35% at 80% 70%, var(--hidden-glow), transparent 70%),
    radial-gradient(40% 30% at 50% 100%, var(--rose), transparent 70%);
  opacity: 0.45;
  filter: blur(40px);
  pointer-events: none;
}
[data-theme="light"] .hero::before { opacity: 0.18; }

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 20px;
}
h1.display {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(38px, 5.5vw, 68px);
  line-height: 1.04;
  letter-spacing: -0.015em;
  margin: 0 0 22px;
}
h1.display em {
  font-style: italic;
  color: var(--mask);
  font-weight: 400;
}
.lede {
  font-size: 17px;
  color: var(--muted);
  max-width: 56ch;
  margin: 0 0 28px;
}
.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 5px 10px;
  border-radius: 100px;
}

/* hero-mask viz */
.mask-orbit { position: relative; aspect-ratio: 1 / 1; max-width: 500px; margin: 0 auto; }
.mask-orbit svg { width: 100%; height: 100%; display: block; }

/* ===== sections ===== */
section { padding: 80px 0; border-top: 1px solid var(--line-soft); position: relative; }
.sec-head { margin-bottom: 44px; }
.sec-tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--mask);
  text-transform: uppercase;
  margin-bottom: 14px;
}
h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.012em;
  margin: 0 0 14px;
  max-width: 22ch;
}
.sec-lede { color: var(--muted); max-width: 66ch; font-size: 16px; }

/* ===== card grid ===== */
.grid { display: grid; gap: 18px; }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 880px) {
  .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover { border-color: var(--mask); transform: translateY(-2px); }
.card.glow-mask { border-left: 3px solid var(--mask); }
.card.glow-suppress { border-left: 3px solid var(--suppress); }
.card.glow-charisma { border-left: 3px solid var(--charisma); }
.card.glow-hidden { border-left: 3px solid var(--hidden); }
.card.glow-defense { border-left: 3px solid var(--defense); }
.card.glow-rose { border-left: 3px solid var(--rose); }

.card-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.card h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 19px;
  margin: 0 0 10px;
  line-height: 1.25;
}
.card p { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.card .meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  margin-top: 14px;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===== heatmap ===== */
.heatmap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  overflow-x: auto;
}
.heatmap table {
  border-collapse: collapse;
  width: 100%;
  font-family: var(--mono);
  font-size: 11px;
}
.heatmap th, .heatmap td {
  padding: 8px 10px;
  text-align: center;
  border-bottom: 1px solid var(--line-soft);
}
.heatmap th {
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.heatmap th:first-child, .heatmap td:first-child {
  text-align: left;
  color: var(--text);
  font-family: var(--display);
  font-size: 13px;
  font-weight: 500;
}
.heatmap .cell {
  display: inline-block;
  width: 100%;
  padding: 6px 4px;
  border-radius: 4px;
  font-weight: 600;
  color: var(--bg);
}

/* ===== switch graph (radial) ===== */
.switch-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: center;
}
@media (max-width: 880px) { .switch-wrap { grid-template-columns: 1fr; } }
.switch-wrap svg { width: 100%; height: auto; }

.context-list { display: grid; gap: 10px; }
.context-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  font-size: 13px;
}
.context-row .dot { width: 10px; height: 10px; border-radius: 50%; }
.context-row .label { font-family: var(--display); font-size: 14px; }
.context-row .cost { font-family: var(--mono); font-size: 11px; color: var(--muted); }

/* ===== suppression slider ===== */
.suppress-lab {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
}
.suppress-lab .slider-row {
  display: grid; gap: 8px;
  margin: 18px 0;
}
.suppress-lab label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
  display: flex; justify-content: space-between;
}
.suppress-lab input[type=range] {
  width: 100%;
  accent-color: var(--mask);
}
.suppress-lab .out {
  margin-top: 22px;
  padding: 18px;
  background: var(--surface-2);
  border-left: 3px solid var(--suppress);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
}
.suppress-lab .out strong { color: var(--suppress); font-family: var(--display); font-weight: 600; }

/* ===== ai mirror ===== */
.mirror-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
}
.prompt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-bottom: 18px; }
.prompt-btn {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  text-align: left;
  padding: 14px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--body);
  font-size: 13px;
  transition: all 0.18s ease;
}
.prompt-btn:hover { border-color: var(--mask); transform: translateY(-1px); }
.prompt-btn .pt-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--mask);
  text-transform: uppercase;
  display: block;
  margin-bottom: 6px;
}
.mirror-input { display: flex; gap: 10px; margin-bottom: 16px; }
.mirror-input textarea {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font-family: var(--body);
  font-size: 14px;
  color: var(--text);
  resize: vertical;
  min-height: 70px;
}
.mirror-input textarea:focus { outline: none; border-color: var(--mask); }
.mirror-input button {
  background: var(--mask);
  color: var(--bg);
  border: 0;
  border-radius: 8px;
  padding: 0 22px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  cursor: pointer;
  font-weight: 600;
}
.mirror-out {
  background: var(--surface-2);
  border-left: 3px solid var(--mask);
  border-radius: 6px;
  padding: 20px 22px;
  font-size: 15px;
  line-height: 1.7;
  white-space: pre-wrap;
  min-height: 80px;
  color: var(--text);
}
.mirror-out:empty::before {
  content: 'Pick a probe above or describe a context.';
  color: var(--dim);
  font-style: italic;
}
html[data-lang="zh"] .mirror-out:empty::before { content: '从上方选择一个探针，或描述一个具体场景。'; }

/* ===== guardrails ===== */
.rails {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--suppress);
  border-radius: 12px;
  padding: 26px 28px;
}
.rails h3 {
  font-family: var(--display);
  margin: 0 0 14px;
  font-size: 18px;
  color: var(--suppress);
}
.rails ul { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; }
.rails li { margin-bottom: 8px; }

/* ===== footer ===== */
footer {
  border-top: 1px solid var(--line-soft);
  padding: 40px 24px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
footer a { color: var(--muted); border-bottom: 1px dotted var(--line); }
footer a:hover { color: var(--mask); }
