:root {
  color-scheme: dark;
  --ink: #071411;
  --paper: #eff5e9;
  --muted: #8da098;
  --line: rgba(194, 222, 204, 0.16);
  --acid: #c8ff4d;
  --cyan: #75e9d2;
  --orange: #ff9b61;
  --violet: #a79af8;
  --rose: #f789a6;
  --blue: #73a7ff;
  --radius: 24px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--ink); }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--paper);
  background:
    radial-gradient(circle at 70% 20%, rgba(70, 139, 121, 0.15), transparent 34rem),
    linear-gradient(135deg, #071411, #09100e 54%, #111712);
}

button, a { font: inherit; }
button { color: inherit; }

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 90%);
}

.section-index {
  color: var(--cyan);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.app { min-height: 100vh; }

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 84px;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 20, 17, 0.82);
  backdrop-filter: blur(18px);
}

.brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.brand__mark { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--acid); border-radius: 50%; color: var(--acid); }
.brand strong, .brand small { display: block; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.topbar__question { color: #aebdb6; font-size: 13px; }
.ghost-button { justify-self: end; padding: 9px 15px; border: 1px solid var(--line); border-radius: 999px; background: transparent; cursor: pointer; }

.experience {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 410px;
  min-height: calc(100vh - 132px);
}

.stage { padding: 42px 34px 24px; border-right: 1px solid var(--line); }
.stage__head { display: flex; justify-content: space-between; align-items: end; gap: 24px; }
.stage h2 { margin: 10px 0 0; font-size: clamp(28px, 3vw, 44px); font-weight: 500; letter-spacing: -0.035em; }
.stage__hint { margin: 12px 0 22px; color: var(--muted); }

.lens-switch { display: flex; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,0.025); }
.lens-switch button { padding: 10px 15px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; }
.lens-switch button.is-active { color: #0a1712; background: var(--paper); }

.field {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  min-height: 570px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(255,255,255,0.018);
}

.group-card {
  min-width: 0;
  padding: 18px 12px 14px;
  border: 1px solid transparent;
  border-radius: 17px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.035), rgba(255,255,255,0.012));
  transition: border-color 260ms ease, background 260ms ease;
}

.group-card.has-selected { border-color: color-mix(in srgb, var(--accent), transparent 45%); background: color-mix(in srgb, var(--accent), transparent 92%); }

.group-card__head { min-height: 74px; }
.group-card__code { color: var(--accent, var(--cyan)); font: 600 11px/1 monospace; letter-spacing: .1em; }
.group-card h3 { margin: 8px 0 4px; font-size: 15px; line-height: 1.35; }
.group-card__count { color: var(--muted); font-size: 11px; }
.node-list { display: grid; gap: 5px; margin-top: 12px; }

.company-node {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: rgba(255,255,255,.025);
  color: #b9c8c1;
  cursor: pointer;
  text-align: left;
  font-size: 12px;
  overflow: hidden;
  will-change: transform;
  transition: transform 780ms cubic-bezier(.22,.8,.2,1), border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.company-node::before { content: ""; flex: 0 0 auto; width: 7px; height: 7px; border-radius: 2px; background: var(--node-color, var(--cyan)); box-shadow: 0 0 12px color-mix(in srgb, var(--node-color), transparent 30%); }
.company-node span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-node:hover, .company-node:focus-visible { border-color: var(--node-color); color: white; outline: none; }
.company-node.is-selected { border-color: var(--node-color); color: white; background: color-mix(in srgb, var(--node-color), transparent 87%); }
.company-node.is-selected::before { border-radius: 50%; box-shadow: 0 0 0 4px color-mix(in srgb, var(--node-color), transparent 78%), 0 0 18px var(--node-color); }
.company-node.is-focus { border-color: var(--node-color); color: white; background: color-mix(in srgb, var(--node-color), transparent 82%); }
.company-node.is-dimmed { opacity: .16; filter: grayscale(.75); }

.stage__footer { display: flex; justify-content: space-between; padding: 14px 4px 0; color: var(--muted); font-size: 11px; }

.narrative { display: flex; flex-direction: column; padding: 52px 34px 32px; background: rgba(255,255,255,0.012); }
.narrative__kicker { color: var(--acid); font-size: 11px; letter-spacing: .15em; }
.narrative h2 { margin: 18px 0 14px; font-family: Georgia, "Noto Serif SC", serif; font-size: 34px; font-weight: 500; line-height: 1.12; }
.narrative p { color: #9eb0a8; font-size: 13px; line-height: 1.75; }
.metric-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: 28px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.metric-row div { padding: 18px; background: #0b1713; }
.metric-row strong, .metric-row span { display: block; }
.metric-row strong { color: var(--acid); font: 500 32px/1 Georgia, serif; }
.metric-row span { margin-top: 8px; color: var(--muted); font-size: 11px; }
.company-context { display: grid; gap: 9px; margin-top: 22px; }
.pairing-summary { padding: 17px; border-left: 2px solid var(--acid); background: rgba(200,255,77,.045); }
.pairing-summary > span { color: var(--acid); font-size: 10px; letter-spacing: .08em; }
.pairing-summary strong { display: block; margin-top: 8px; font: 500 20px/1.35 Georgia, "Noto Serif SC", serif; }
.pairing-summary strong i { color: var(--acid); font-style: normal; }
.pairing-summary p { margin: 8px 0 0; font-size: 11px; line-height: 1.6; }
.context-block { padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.02); }
.context-block.is-primary { border-color: rgba(200,255,77,.32); background: rgba(200,255,77,.045); }
.context-block > span { display: block; margin-bottom: 7px; color: var(--cyan); font-size: 10px; }
.context-block strong { display: block; font-size: 13px; line-height: 1.45; }
.context-block p { margin: 7px 0 0; font-size: 11px; line-height: 1.55; }
.context-block small { display: block; margin-top: 8px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.context-block a { display: inline-flex; margin-top: 9px; color: var(--acid); font-size: 11px; font-weight: 700; text-decoration: none; border-bottom: 1px solid currentColor; }
.context-block--business { border-color: rgba(117,233,210,.25); }
.peer-context { padding: 14px 0; border-block: 1px solid var(--line); }
.peer-context__head { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; }
.peer-context__head strong { color: var(--acid); font: 500 22px/1 Georgia, serif; }
.peer-context > p { margin: 9px 0 0; font-size: 11px; }
.peer-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.peer-list button { padding: 6px 8px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.025); color: #c0cec7; cursor: pointer; font-size: 10px; }
.peer-list button:hover,.peer-list button:focus-visible { border-color: var(--cyan); color: white; outline: none; }
.profile-roadmap { padding: 12px 14px; border: 1px dashed rgba(194,222,204,.2); border-radius: 12px; }
.profile-roadmap span { color: var(--muted); font-size: 10px; }
.profile-roadmap p { margin: 6px 0 0; color: #75877f; font-size: 10px; line-height: 1.55; }
.loading-error { grid-column: 1 / -1; place-self: center; color: var(--orange); }

.page-footer { display: flex; justify-content: space-between; gap: 20px; padding: 16px 34px; border-top: 1px solid var(--line); color: #70827a; font-size: 10px; }

.method-dialog { width: min(520px, calc(100% - 32px)); padding: 34px; border: 1px solid rgba(200,255,77,.28); border-radius: 22px; background: #0c1914; color: var(--paper); box-shadow: 0 32px 120px rgba(0,0,0,.6); }
.method-dialog::backdrop { background: rgba(0,0,0,.68); backdrop-filter: blur(8px); }
.method-dialog h2 { margin: 12px 0 18px; font: 500 32px/1.15 Georgia, serif; }
.method-dialog p { color: #a8b8b0; line-height: 1.7; }
.dialog-close { position: absolute; right: 18px; top: 15px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 24px; }
.evidence-stat { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 18px; margin: 22px 0; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.025); }
.evidence-stat strong { color: var(--acid); font: 500 48px/1 Georgia, serif; }
.evidence-stat span { color: #b7c5be; font-size: 12px; line-height: 1.5; }
.evidence-note { padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; }

@media (max-width: 920px) {
  .topbar { grid-template-columns: 1fr auto; }
  .topbar__question { display: none; }
  .experience { grid-template-columns: 1fr; }
  .stage { border-right: 0; }
  .narrative { min-height: 420px; border-top: 1px solid var(--line); }
  .field { overflow-x: auto; grid-template-columns: repeat(5, minmax(230px, 1fr)); scroll-snap-type: x mandatory; }
  .group-card { scroll-snap-align: start; }
}

@media (max-width: 620px) {
  .topbar { min-height: 70px; padding: 0 18px; }
  .stage { padding: 30px 16px 20px; }
  .stage__head { align-items: stretch; flex-direction: column; }
  .lens-switch { align-self: stretch; }
  .lens-switch button { flex: 1; }
  .field { min-height: 520px; }
  .group-card { min-width: min(82vw, 300px); }
  .company-node { min-height: 38px; font-size: 12px; }
  .stage__footer, .page-footer { flex-direction: column; }
  .narrative { padding: 42px 20px 24px; }
  .page-footer { padding: 16px 20px; }
  .method-dialog { max-height: calc(100vh - 24px); overflow-y: auto; padding: 28px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
