:root {
  --bg: #08080a;
  --fg: #e8e8ea;
  --dim: #8a8a92;
  --line: #1e1e24;
  --line-bright: #2c2c36;
  --cyan: #22d3ee;
  --violet: #a78bfa;
  --amber: #fbbf24;
  --red: #f87171;
  --green: #34d399;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { background: var(--bg); scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 100% 3px;
  z-index: 0;
}

a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--line-bright); }
a:hover { color: var(--cyan); border-bottom-color: var(--cyan); }

::selection { background: var(--cyan); color: #000; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 99;
  background: var(--bg);
  border: 1px solid var(--cyan);
  padding: 8px 12px;
}
.skip:focus { left: 12px; top: 12px; }

.wrap { position: relative; z-index: 1; max-width: 920px; margin: 0 auto; padding: 0 24px; }

header {
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(8,8,10,.86);
  backdrop-filter: blur(8px);
  z-index: 2;
}

.bar {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { font-weight: 700; letter-spacing: .18em; border: 0; }
.brand span { color: var(--dim); font-weight: 400; letter-spacing: .06em; }

nav { display: flex; gap: 18px; font-size: 13px; color: var(--dim); align-items: center; }
nav a { border: 0; }
nav a:hover { color: var(--fg); }
nav a.active { color: var(--fg); }
.lang { display: flex; gap: 6px; align-items: center; border-left: 1px solid var(--line); padding-left: 16px; }

/* hero */
.hero { padding: 72px 0 64px; border-top: 0; }

.logo {
  margin: 0;
  font-size: clamp(7px, 1.55vw, 13px);
  line-height: 1.15;
  font-weight: 700;
  background: linear-gradient(92deg, var(--cyan), var(--violet) 72%);
  background-size: 200% 100%;
  animation: drift 9s ease-in-out infinite;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: pre;
  overflow-x: auto;
}

.kicker {
  margin: 26px 0 0;
  color: var(--dim);
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1 {
  margin: 14px 0 18px;
  font-size: clamp(30px, 5.2vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 700;
}

.lede { margin: 0; max-width: 62ch; color: #b9b9c0; }
.cn { margin: 10px 0 0; color: var(--dim); font-size: 14px; }

.cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 30px 0 0; align-items: center; }

.btn {
  display: inline-block;
  padding: 9px 15px;
  border: 1px solid var(--line-bright);
  color: var(--fg);
  font-size: 13px;
  letter-spacing: .04em;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}

.btn:hover { background: var(--fg); color: #000; border-color: var(--fg); }
.btn.primary { border-color: var(--cyan); color: var(--cyan); }
.btn.primary:hover { background: var(--cyan); color: #000; }
.btn.small { padding: 6px 10px; font-size: 12px; }

.stars { display: inline-flex; gap: 6px; align-items: center; color: var(--dim); font-size: 12px; border: 1px solid var(--line); padding: 6px 10px; }
.stars b { color: var(--fg); font-weight: 600; }
.stars[hidden] { display: none; }

.release { margin: 12px 0 0; color: var(--dim); font-size: 12px; }

.term {
  margin: 34px 0 0;
  padding: 16px 18px;
  background: #0c0c10;
  border: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.7;
  color: #c9c9d1;
  overflow-x: auto;
}

.term .p { color: var(--cyan); }
.term .d { color: var(--dim); }
.term .v { color: var(--violet); }

.term .bar {
  display: inline-block;
  width: 210px;
  height: 11px;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--cyan));
  background-size: 200% 100%;
  animation: bar 4s linear infinite;
  vertical-align: -1px;
}

.term .caret {
  display: inline-block;
  width: .62em;
  height: 1em;
  background: var(--cyan);
  vertical-align: -2px;
  animation: blink 1.15s steps(1) infinite;
}

@keyframes drift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes bar { to { background-position: -200% 0; } }
@keyframes blink { 50% { opacity: 0; } }

/* sections */
section { padding: 58px 0; border-top: 1px solid var(--line); }

.sec-label {
  margin: 0 0 26px;
  color: var(--dim);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
}

h2 {
  margin: 0 0 18px;
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

p { margin: 0 0 14px; color: #b9b9c0; max-width: 70ch; }

.rows { margin-top: 8px; border-top: 1px solid var(--line); }
.row { display: flex; gap: 18px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.row .n { color: var(--dim); min-width: 34px; }
.row .t { flex: 1; color: #cfcfd6; }
.row .t b { color: var(--fg); font-weight: 600; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.card {
  background: var(--bg);
  padding: 20px;
  transition: background .18s ease, transform .18s ease;
}
.card:hover { background: #0d0d11; transform: translateY(-2px); }
.card .k { color: var(--cyan); font-size: 12px; letter-spacing: .12em; }
.card h3 { margin: 10px 0 8px; font-size: 15px; letter-spacing: 0; }
.card p { margin: 0; font-size: 13px; color: var(--dim); overflow-wrap: anywhere; }

/* data flow */
.flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 26px 0 0;
}
.flow .box { border: 1px solid var(--line-bright); padding: 12px; font-size: 13px; background: #0c0c10; }
.flow .box b { display: block; color: var(--fg); font-weight: 600; }
.flow .box span { color: var(--dim); font-size: 12px; }
.flow .arrow { color: var(--cyan); }

/* interactive demo */
.demo {
  margin-top: 22px;
  border: 1px solid var(--line-bright);
  border-radius: 7px;
  background: #0a0a0e;
  overflow: hidden;
}
.demo-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: #0c0c10;
  color: var(--dim);
  font-size: 12px;
}
.demo-dots { display: flex; gap: 6px; }
.demo-dots i { width: 8px; height: 8px; border-radius: 50%; background: #2c2c36; }
.demo-dots i:nth-child(1) { background: #8a4d4d; }
.demo-dots i:nth-child(2) { background: #8a744d; }
.demo-dots i:nth-child(3) { background: #4d7d68; }
.demo-title { color: #9a9aa4; text-align: center; letter-spacing: .04em; }
.demo-size { color: var(--dim); justify-self: end; }
.demo-pan { display: none; color: var(--cyan); }
.demo-body {
  padding: 16px 18px 18px;
  height: 320px;
  background: #070709;
  font-size: 12px;
  line-height: 1.42;
  overflow: auto;
  transition: height .32s ease;
}
.demo-body.expanded { height: 880px; }
.demo-body .dim { color: var(--dim); }
.demo-body .ok { color: var(--cyan); }
.demo-body .good { color: var(--green); }
.demo-body .v { color: var(--violet); }
.demo-body .warn { color: var(--amber); }
.demo-body .bad { color: var(--red); }

/* simulated scan log */
.tui-run,
.tui-wizard,
.tui-after,
.tui-apply-note,
.tui-apply-log,
.tui-rollback,
.tui-prompt,
.tui-ask { width: 100ch; }

.tui-run {
  margin: 0;
  color: #c9c9d1;
  white-space: pre;
  line-height: 1.55;
}
.tui-run .prompt { color: var(--cyan); }
.tui-run .spin { color: var(--cyan); }
.tui-run .pbar-on {
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tui-run .pbar-off { color: #34343e; }

/* dashboard, rebuilt from app/noir/core/Tui.kt */
.tui {
  width: 100ch;
  border: 1px solid #6e6e7a;
  border-radius: 9px;
  padding: 12px 16px 14px;
  color: #c9c9d1;
}
.tui-brand { display: flex; align-items: flex-start; gap: 3ch; }
.tui-logo { margin: 0; line-height: 1.42; white-space: pre; }
.tui-logo-line {
  display: block;
  background: linear-gradient(92deg, var(--cyan), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tui-tags { line-height: 1.42; white-space: pre; }
.tui-tags > * { display: block; }
.tui-tags b { color: var(--fg); font-weight: 700; }
.tui-tags span { color: var(--dim); }
.tui-tags .blank { height: 1.42em; }

.tui-sec {
  display: flex;
  align-items: center;
  gap: 1.2ch;
  margin: 14px 0 5px;
}
.tui-sec::before,
.tui-sec::after {
  content: "";
  height: 1px;
  background: #45454f;
}
.tui-sec::before { flex: 0 0 1.2ch; }
.tui-sec::after { flex: 1; }
.tui-sec-label {
  color: var(--fg);
  font-size: .95em;
  font-weight: 700;
  letter-spacing: .08em;
  white-space: nowrap;
}

.tui-kv { display: flex; align-items: baseline; }
.tui-kv .k { width: 9ch; flex: none; color: var(--dim); }
.tui-kv .v { white-space: pre; }

.tui-exp {
  display: grid;
  grid-template-columns: 12ch 30ch 4ch 4ch;
  column-gap: 1.5ch;
  align-items: baseline;
  white-space: nowrap;
}
.tui-exp .cat { color: var(--fg); }
.tui-exp .count { color: var(--fg); text-align: right; }
.tui-exp .pct { color: var(--dim); text-align: right; }
.tui-exp.uncat .cat,
.tui-exp.uncat .count { color: var(--dim); }
.tui-bar { letter-spacing: 0; }
.tui-bar-on {
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tui-bar-off { color: #34343e; }
.tui-dots { color: #45454f; letter-spacing: .08em; }

.tui-find {
  display: grid;
  grid-template-columns: 2ch 5ch 10ch minmax(20ch, 1fr) 2ch 3ch;
  column-gap: 1.5ch;
  align-items: baseline;
  white-space: nowrap;
}
.tui-find.head,
.tui-find.head .cat,
.tui-find.head .pkg,
.tui-find.head .up,
.tui-find.head .cmd { color: var(--dim); }
.tui-find .num { color: var(--dim); text-align: right; }
.tui-find .score { text-align: right; }
.tui-find .cat,
.tui-find .pkg { color: var(--fg); overflow: hidden; text-overflow: ellipsis; }
.tui-find .up,
.tui-find .cmd { color: var(--dim); text-align: right; }

.tui-plan { display: grid; gap: 1px; }
.tui-planrow { display: flex; align-items: baseline; gap: 3ch; white-space: pre; }
.tui-planrow > .k { width: 9ch; flex: none; color: var(--dim); }
.tui-risk { display: flex; gap: 2.5ch; }
.tui-risk > span { color: var(--dim); white-space: nowrap; }
.tui-risk .red { color: var(--red); }
.tui-risk .amber { color: var(--amber); }
.tui-risk .green { color: var(--green); }
.tui-actions { display: flex; gap: 3ch; flex-wrap: wrap; }
.tui-actions > span { color: #c9c9d1; white-space: nowrap; }
.tui-actions .more { color: var(--dim); }
.tui-planrow .safe-n { color: var(--green); }

.tui-after { margin-top: 14px; line-height: 1.42; }
.tui-after > div { white-space: pre; }
.tui-after .report-k { color: var(--dim); }
.tui-prompt { margin-top: 14px; }
.tui-caret {
  display: inline-block;
  width: .62em;
  height: 1em;
  background: var(--cyan);
  vertical-align: -2px;
  animation: blink 1.15s steps(1) infinite;
}
.tui-command { color: #c9c9d1; }
.tui-command .ok { color: var(--cyan); }
.tui-wizard .tui-banner {
  margin: 0 0 4px;
  color: #c9c9d1;
  font-size: .9em;
  line-height: 1.1;
  white-space: pre;
}
.tui-wizard .tui-first { padding-left: 2ch; color: var(--dim); }
.tui-wizard .tui-kv { padding-left: 2ch; }
.tui-wizard-gap { height: 10px; }

.tui-ask {
  display: block;
  margin-top: 12px;
  padding-left: 2ch;
  white-space: pre;
}
.tui-ask .ask-q { white-space: pre; }
.tui-choice {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--cyan);
  font: inherit;
  line-height: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.tui-choice:hover { color: var(--fg); }
.tui-choice:focus-visible { outline: 1px solid var(--cyan); outline-offset: 2px; }

.tui-apply-note { margin-top: 14px; padding-left: 2ch; color: var(--dim); }
.tui-apply-log { margin-top: 8px; padding-left: 2ch; }
.tui-apply { display: flex; gap: 2ch; white-space: pre; }
.tui-apply .cmd { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tui-apply .status { color: var(--green); }
.tui-rollback { margin-top: 8px; padding-left: 2ch; color: var(--dim); }
.tui-rollback .path { color: #c9c9d1; }

.tui-fallback { white-space: normal; color: var(--dim); }

.demo-actions {
  display: none;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}
.js .demo-actions { display: flex; }
.demo-actions button {
  font: inherit;
  font-size: 12px;
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line-bright);
  padding: 6px 10px;
  cursor: pointer;
}
.demo-actions button:hover:not(:disabled) { border-color: var(--cyan); color: var(--cyan); }
.demo-actions button:disabled { color: var(--dim); cursor: default; }
.demo-note { color: var(--dim); font-size: 11px; margin-left: auto; text-align: right; }

/* code */
.code-wrap { position: relative; margin: 0 0 18px; }
.code {
  margin: 0;
  padding: 14px 16px;
  background: #0c0c10;
  border: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
  color: #c9c9d1;
  max-width: 100%;
}
.code .c { color: var(--dim); }
.code .p { color: var(--cyan); }
.copy {
  position: absolute;
  top: -9px;
  right: 8px;
  font: inherit;
  font-size: 11px;
  background: var(--bg);
  color: var(--dim);
  border: 1px solid var(--line);
  padding: 3px 7px;
  cursor: pointer;
}
.copy:hover { color: var(--cyan); border-color: var(--cyan); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
section[id] { scroll-margin-top: 72px; }
.cols > div, .grid > .card { min-width: 0; }
.cols h3 { margin: 0 0 10px; font-size: 13px; color: var(--dim); letter-spacing: .12em; text-transform: uppercase; }

/* limits */
ul.limits { margin: 0; padding: 0; list-style: none; }
ul.limits li { padding: 9px 0; border-bottom: 1px solid var(--line); color: #b9b9c0; font-size: 13px; }
ul.limits li::before { content: "— "; color: var(--dim); }

/* faq */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; color: var(--fg); list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "+ "; color: var(--cyan); }
.faq details[open] summary::before { content: "− "; }
.faq p { margin: 10px 0 0; font-size: 13px; color: var(--dim); }

/* comparison */
.compare { width: 100%; border-collapse: collapse; font-size: 13px; }
.compare th, .compare td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare th { color: var(--dim); font-weight: 400; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.compare td:first-child { color: var(--fg); }
.compare td { color: #b9b9c0; }

/* contact */
.contact { margin-top: 10px; border-top: 1px solid var(--line); }
.contact-row {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  border-left: 0;
  border-right: 0;
  border-top: 0;
  font-size: 13px;
  align-items: baseline;
  transition: color .15s ease, border-bottom-color .15s ease;
}
.contact-row:hover { color: var(--fg); border-bottom-color: var(--cyan); }
.contact-row .k { color: var(--dim); }
.contact-row .v { color: var(--cyan); }
.contact-row:hover .v { color: var(--fg); }
.contact-row .d { color: var(--dim); text-align: right; }

/* reveal */
.js .reveal { opacity: 0; transform: translateY(10px); transition: opacity .55s ease, transform .55s ease; }
.js .reveal.in { opacity: 1; transform: none; }

footer { border-top: 1px solid var(--line); padding: 34px 0 60px; color: var(--dim); font-size: 12px; }
footer .links { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 14px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}

@media (max-width: 760px) {
  nav a:not(.keep):not(.lang-link) { display: none; }
  .lang { border-left: 0; padding-left: 0; }
}

@media (max-width: 620px) {
  .bar { padding: 12px 18px; gap: 10px; }
  .brand span { display: none; }
  nav { gap: 12px; }
  .wrap { padding: 0 18px; }
}

@media (max-width: 700px) {
  .cols { grid-template-columns: 1fr; }
  .term { font-size: 12px; padding: 14px; }
  .term .bar { width: 120px; }
  .hero { padding: 48px 0 44px; }
  section { padding: 44px 0; }
  .flow { grid-template-columns: 1fr; }
  .flow .arrow { justify-self: start; transform: rotate(90deg); }
  .demo-bar { padding: 8px 10px; }
  .demo-size { display: none; }
  .demo-pan { display: inline; justify-self: end; }
  .demo-body { height: 300px; padding: 10px; font-size: 10px; }
  .demo-body.expanded { height: 740px; }
  .tui { padding: 10px 12px; }
  .tui-sec { margin: 10px 0 3px; }
  .tui-wizard,
  .tui-after,
  .tui-apply-note,
  .tui-rollback,
  .tui-prompt,
  .tui-ask { width: auto; }
  .tui-ask { white-space: normal; }
  .demo-note { display: none; }
  .code { white-space: pre-wrap; overflow-wrap: anywhere; }
  .contact-row { grid-template-columns: 80px 1fr; }
  .contact-row .d { display: none; }
  .compare th:nth-child(3), .compare td:nth-child(3) { display: none; }
}
