:root {
  color-scheme: dark;
  --bg: #07090d;
  --panel: rgba(17, 21, 29, 0.78);
  --panel-strong: #11151d;
  --line: rgba(255, 255, 255, 0.1);
  --muted: #8b95a7;
  --text: #f3f6fb;
  --accent: #ff5a45;
  --accent-soft: rgba(255, 90, 69, 0.14);
  --green: #52d49b;
  --green-soft: rgba(82, 212, 155, 0.12);
  --blue: #78a8ff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 12% -10%, rgba(74, 100, 180, 0.18), transparent 32%),
    radial-gradient(circle at 90% 20%, rgba(255, 90, 69, 0.1), transparent 26%),
    var(--bg);
  overflow-x: hidden;
}

button, input { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

.ambient {
  position: fixed;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
  opacity: 0.17;
}
.ambient-one { background: #4d6cff; top: 22%; left: -220px; }
.ambient-two { background: var(--accent); top: 5%; right: -250px; }

.shell { width: min(1440px, calc(100% - 48px)); margin: 0 auto; }

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: 0.08em; }
.brand-mark {
  width: 34px; height: 34px; display: grid; place-items: center;
  color: #0b0d11; background: var(--text); border-radius: 9px; font-weight: 900;
}
.topbar-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.topbar-meta a { color: var(--text); margin-left: 14px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 14px var(--green); }

.hero { padding: 58px 0 46px; }
.eyebrow, .section-kicker { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: 0.17em; margin: 0 0 12px; }
.hero h1 { font-size: clamp(46px, 6.2vw, 88px); line-height: 0.94; letter-spacing: -0.055em; margin: 0; max-width: 900px; }
.lede { max-width: 680px; margin: 24px 0 0; color: #abb4c4; font-size: 18px; line-height: 1.6; }

.demo-layout { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(320px, 0.72fr); gap: 18px; }
.panel, .result-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.graph-panel { padding: 24px; min-height: 455px; }
.controls-panel { padding: 24px; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.panel-heading.compact { margin-bottom: 22px; }
.panel-heading h2, .result-card h2 { margin: 0; font-size: 20px; letter-spacing: -0.025em; }

.status-pill, .result-meta span {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 999px; font-size: 11px; font-weight: 750;
}
.status-pill.neutral { color: #b9c1cf; background: rgba(255,255,255,.035); }
.status-pill.danger { color: #ffb2a6; border-color: rgba(255,90,69,.35); background: var(--accent-soft); }
.status-pill.success { color: #92e7bd; border-color: rgba(82,212,155,.3); background: var(--green-soft); }

.graph {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 56px;
  min-height: 315px;
  padding: 50px 4px 28px;
}
.repo-node {
  position: relative; z-index: 2; min-width: 0; min-height: 154px; padding: 22px;
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
  background: linear-gradient(145deg, rgba(30,36,48,.95), rgba(15,19,26,.96));
  border: 1px solid rgba(255,255,255,.11); border-radius: 16px;
  transition: border-color .3s ease, transform .3s ease, box-shadow .3s ease;
}
.repo-node p { margin: 16px 0 6px; font-size: 9px; font-weight: 800; letter-spacing: .14em; color: var(--muted); }
.repo-node h3 { margin: 0 0 8px; font-size: clamp(15px, 1.4vw, 20px); letter-spacing: -.025em; overflow-wrap: anywhere; }
.repo-node small { color: var(--muted); font-size: 11px; }
.repo-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; font-size: 10px; font-weight: 900; }
.app-icon { background: rgba(120,168,255,.15); color: #a8c5ff; }
.bff-icon { background: rgba(164,126,255,.15); color: #c6adff; }
.api-icon { background: rgba(82,212,155,.13); color: #87e4b5; }
.hop-badge, .change-badge { display: none; position: absolute; top: -10px; right: 12px; padding: 5px 8px; border-radius: 999px; font-size: 9px; font-weight: 800; }
.hop-badge { color: #ffd0c8; background: #61251f; border: 1px solid #a74437; }
.change-badge { color: #fff; background: var(--accent); }

.edge { position: absolute; top: 50%; height: 2px; z-index: 1; background: rgba(255,255,255,.16); }
.edge::after { content: ""; position: absolute; right: -1px; top: -4px; border-left: 7px solid rgba(255,255,255,.26); border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.edge span { position: absolute; top: -23px; left: 50%; transform: translateX(-50%); white-space: nowrap; color: #687286; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.edge-one { left: 29%; width: 8%; }
.edge-two { left: 63%; width: 8%; }

.graph.is-breaking .source-node { border-color: rgba(255,90,69,.85); box-shadow: 0 0 0 4px rgba(255,90,69,.08), 0 16px 44px rgba(255,90,69,.17); transform: translateY(-4px); }
.graph.is-breaking .change-badge, .graph.is-breaking .hop-badge { display: block; animation: pop .35s ease both; }
.graph.is-breaking .edge { background: linear-gradient(90deg, var(--accent), #ff967d); box-shadow: 0 0 12px rgba(255,90,69,.7); }
.graph.is-breaking .edge::after { border-left-color: #ff967d; }
.graph.is-breaking .repo-node:not(.source-node) { border-color: rgba(255,90,69,.43); box-shadow: 0 0 0 3px rgba(255,90,69,.05); }
.graph.is-breaking .repo-node[data-repo="employee-app-server"] { animation: impactPulse .55s .18s both; }
.graph.is-breaking .repo-node[data-repo="employee-app"] { animation: impactPulse .55s .42s both; }
.graph.is-safe .source-node { border-color: rgba(82,212,155,.62); box-shadow: 0 0 0 4px rgba(82,212,155,.07); }

.legend { display: flex; flex-wrap: wrap; gap: 18px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.legend span { display: flex; align-items: center; gap: 7px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; background: #6f7785; }
.legend-dot.affected { background: var(--accent); }
.legend-dot.safe { background: var(--green); }

label { display: block; margin: 16px 0 8px; color: #c7ced9; font-size: 12px; font-weight: 700; }
label span { color: var(--muted); font-weight: 500; }
input {
  width: 100%; height: 44px; padding: 0 13px; color: var(--text); outline: none;
  background: rgba(7,9,13,.7); border: 1px solid var(--line); border-radius: 10px;
}
input:focus { border-color: rgba(120,168,255,.6); box-shadow: 0 0 0 3px rgba(120,168,255,.08); }
.field-note { margin: 7px 0 0; color: #687286; font-size: 10px; }
.scenario-grid { display: grid; gap: 9px; margin: 20px 0; }
.scenario-button {
  width: 100%; min-height: 63px; display: flex; align-items: center; gap: 12px; text-align: left;
  border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); cursor: pointer;
  transition: transform .2s, border-color .2s, background .2s;
}
.scenario-button:hover { transform: translateY(-1px); border-color: rgba(255,255,255,.24); background: rgba(255,255,255,.045); }
.scenario-button.primary { background: var(--accent-soft); border-color: rgba(255,90,69,.34); }
.scenario-button:disabled { opacity: .52; cursor: wait; transform: none; }
.button-icon { width: 31px; height: 31px; display: grid; place-items: center; margin-left: 3px; border-radius: 8px; background: rgba(255,255,255,.07); }
.scenario-button strong, .scenario-button small { display: block; }
.scenario-button strong { font-size: 12px; }
.scenario-button small { margin-top: 4px; color: var(--muted); font-size: 10px; }

.pipeline { list-style: none; margin: 0; padding: 15px 0 0; border-top: 1px solid var(--line); }
.pipeline li { display: flex; align-items: center; gap: 9px; margin: 10px 0; color: #657083; font-size: 11px; transition: color .25s; }
.pipeline li span { width: 21px; height: 21px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; font-size: 9px; }
.pipeline li.active { color: #fff; }
.pipeline li.active span { border-color: var(--blue); background: rgba(120,168,255,.13); color: #a8c5ff; }
.pipeline li.done { color: #9eddbc; }
.pipeline li.done span { border-color: rgba(82,212,155,.45); background: var(--green-soft); }
.form-error { min-height: 16px; color: #ff9a8a; font-size: 11px; margin: 12px 0 0; }

.results { display: grid; grid-template-columns: .9fr .9fr 1.2fr; gap: 18px; margin-top: 18px; animation: reveal .45s ease both; }
.results.hidden { display: none; }
.result-card { padding: 23px; min-height: 260px; }
.verdict-line { display: flex; gap: 14px; align-items: flex-start; margin-top: 20px; }
.verdict-line p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.verdict-icon { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; color: #ffc1b7; background: var(--accent-soft); font-weight: 900; }
.verdict-icon.safe { color: #99e7bf; background: var(--green-soft); }
.result-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 22px; }
.result-meta span:first-child { color: #bcd0ff; background: rgba(120,168,255,.08); }
.rationale { color: #8f99aa; font-size: 11px; line-height: 1.55; margin: 16px 0 0; }
.metric-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 22px 0; }
.metric-row div { padding: 14px 8px; text-align: center; background: rgba(255,255,255,.025); border: 1px solid var(--line); border-radius: 10px; }
.metric-row strong, .metric-row span { display: block; }
.metric-row strong { font-size: 23px; }
.metric-row span { color: var(--muted); font-size: 9px; margin-top: 4px; }
.impact-list { display: grid; gap: 8px; }
.impact-item { display: flex; justify-content: space-between; padding: 9px 11px; border-left: 2px solid var(--accent); background: rgba(255,90,69,.055); font-size: 10px; }
.impact-item span { color: var(--muted); }
.empty-state { color: #8f99aa; font-size: 12px; line-height: 1.6; }
.slack-heading { display: flex; align-items: flex-start; justify-content: space-between; }
.slack-previews { display: grid; gap: 9px; margin-top: 18px; max-height: 210px; overflow: auto; }
.slack-message { padding: 13px; color: #bec6d3; background: #0c0f15; border: 1px solid var(--line); border-radius: 10px; white-space: pre-wrap; font: 10px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }

footer { min-height: 84px; display: flex; justify-content: space-between; align-items: center; color: #687286; font-size: 11px; }

@keyframes reveal { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop { from { opacity: 0; transform: scale(.75); } to { opacity: 1; transform: scale(1); } }
@keyframes impactPulse {
  0% { transform: translateY(0); box-shadow: 0 0 0 rgba(255,90,69,0); }
  45% { transform: translateY(-5px); box-shadow: 0 0 32px rgba(255,90,69,.22); }
  100% { transform: translateY(0); box-shadow: 0 0 0 3px rgba(255,90,69,.05); }
}

@media (max-width: 980px) {
  .demo-layout, .results { grid-template-columns: 1fr; }
  .graph-panel { min-height: 430px; }
}
@media (max-width: 720px) {
  .shell { width: min(100% - 26px, 1440px); }
  .topbar-meta { font-size: 0; }
  .topbar-meta a { font-size: 12px; }
  .hero { padding: 40px 0 34px; }
  .hero h1 { font-size: 46px; }
  .graph { grid-template-columns: 1fr; gap: 15px; padding-top: 28px; }
  .edge { display: none; }
  .repo-node { min-height: 116px; }
  footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: 8px; }
}
