@font-face {
  font-family: "Maple Mono";
  src: url("fonts/maple-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Maple Mono";
  src: url("fonts/maple-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Maple Mono";
  src: url("fonts/maple-mono-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Maple Mono";
  src: url("fonts/maple-mono-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0b0d10;
  --bg-soft: #0f1318;
  --panel: rgba(15, 19, 24, .72);
  --border: #26333d;
  --border-soft: #1c272f;
  --text: #d7dde3;
  --muted: #7c8792;
  --dim: #4d5a64;
  --accent: #f5a742;
  --accent-bright: #ffc46b;
  --accent-mid: #a37130;
  --accent-dim: #694924;
  --green: #7fbf8a;
  --mono: "Maple Mono", "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: calc(100vh - 52px);
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
  font: 17px/1.7 var(--mono);
  -webkit-font-smoothing: antialiased;
}

#dither {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: .22;
  image-rendering: pixelated;
  pointer-events: none;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 44%, transparent 0 28%, rgba(11, 13, 16, .55) 72%, var(--bg) 100%),
    repeating-linear-gradient(180deg, transparent 0 3px, rgba(0, 0, 0, .16) 3px 4px);
}
.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(245, 167, 66, .9) .7px, transparent 1.1px);
  background-size: 5px 5px;
  opacity: .055;
  -webkit-mask-image: radial-gradient(ellipse at 50% 43%, #000 0 12%, transparent 62%);
  mask-image: radial-gradient(ellipse at 50% 43%, #000 0 12%, transparent 62%);
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 clamp(18px, 4vw, 42px);
  border-bottom: 1px solid var(--border-soft);
  background: rgba(11, 13, 16, .72);
  backdrop-filter: blur(6px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
}
nav { display: flex; align-items: center; gap: clamp(12px, 2.2vw, 26px); color: var(--muted); font-size: 13px; }
nav a { transition: color .15s ease; }
nav a:hover { color: var(--accent); }
nav .key { margin-right: 4px; }

a { color: inherit; text-decoration: none; }
::selection { background: rgba(245, 167, 66, .28); color: #fff; }

.header-mark { display: inline-flex; gap: 0; }
.header-mark i { display: block; width: 6px; height: 12px; }
.muted { color: var(--muted); }
.b { background: var(--accent); }
.m { background: var(--accent-mid); }
.d { background: var(--accent-dim); }

.key { color: var(--accent); }

main {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: calc(100vh - 52px);
  padding: clamp(54px, 10vh, 104px) 20px 44px;
}

.home {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(980px, 100%);
  text-align: center;
}

.identity { display: flex; flex-direction: column; align-items: center; }

.mark {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  filter: drop-shadow(0 0 20px rgba(245, 167, 66, .14));
}
.mark .bar {
  display: block;
  width: 34px;
  height: 64px;
}
.mark .bar.b { background-color: var(--accent); }
.mark .bar.m { background-color: var(--accent-mid); }
.mark .bar.d { background-color: var(--accent-dim); }

.wordmark {
  margin: 0;
  color: var(--accent);
  font-family: var(--mono);
  font-size: clamp(8px, 1.2vw, 16px);
  line-height: 1.04;
  letter-spacing: 0;
  white-space: pre;
  font-variant-ligatures: none;
  text-rendering: geometricPrecision;
  text-shadow: 0 0 22px rgba(245, 167, 66, .17);
}

.tagline {
  margin: 26px 0 5px;
  color: #e1e7eb;
  font-size: 18px;
}
.sub {
  max-width: 62ch;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.actions {
  display: flex;
  flex-direction: column;
  width: min(680px, 100%);
  margin-top: 32px;
  text-align: left;
}
.actions a {
  display: grid;
  grid-template-columns: 3ch 14ch minmax(0, 1fr);
  align-items: baseline;
  padding: 7px 10px;
  border-radius: 5px;
  transition: background .12s ease;
}
.actions a:hover { background: rgba(245, 167, 66, .065); }
.actions .name { color: #e2e8ed; padding-right: 10px; }
.actions .desc { color: var(--muted); font-size: 14px; }

.copy {
  border: 0;
  padding: 0 0 0 8px;
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.copy:hover { color: var(--accent); }

.panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 20px;
  width: 100%;
  max-width: 980px;
  margin-top: 48px;
  text-align: left;
}
.panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 392px;
  padding: 32px 26px 24px;
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  background: var(--panel);
}
.panel h2 {
  position: absolute;
  top: -9px;
  left: 18px;
  margin: 0;
  padding: 0 8px;
  background: var(--bg);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.panel-lede { max-width: 48ch; margin: 0 0 24px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.quick, .capabilities { display: flex; flex-direction: column; gap: 16px; width: 100%; }
.step { display: grid; grid-template-columns: 3ch minmax(0, 1fr); gap: 12px; align-items: start; width: 100%; }
.step-body { min-width: 0; width: 100%; }
.step-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.command {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: #0d1218;
  transition: border-color .15s ease;
}
.command:hover { border-color: var(--border); }
.command code {
  flex: 1;
  min-width: 0;
  color: #dbe3e9;
  font-size: 12px;
  line-height: 1.55;
  white-space: normal;
  overflow-wrap: anywhere;
}
.command .copy { flex: 0 0 auto; padding-left: 0; line-height: 1.55; }
.command .nowrap { white-space: nowrap; }
.num { color: var(--accent-dim); font-size: 11px; letter-spacing: .04em; padding-top: 2px; }
.panel-tip {
  margin: auto 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--border-soft);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}
.tip-label {
  display: inline-block;
  margin-right: 7px;
  color: var(--accent-dim);
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.panel-foot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 18px;
  align-self: flex-start;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: .01em;
}
.panel-foot span { transition: transform .15s ease; }
.panel-foot:hover span { transform: translateX(3px); }
.capabilities { gap: 0; }
.cap { padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.cap:first-child { padding-top: 0; }
.cap:last-child { padding-bottom: 0; border-bottom: 0; }
.cap-title { display: flex; align-items: center; gap: 9px; margin-bottom: 5px; }
.cap .icon { color: var(--accent-dim); }
.cap-key { color: var(--accent); font-size: 12.5px; letter-spacing: .02em; }
.cap-ops {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}
.cap-ops code {
  padding: 0;
  border: 0;
  background: none;
  color: #aeb8c1;
  font-family: var(--mono);
  font-size: inherit;
}
.cap-extra {
  margin: auto 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--border-soft);
  color: var(--dim);
  font-size: 11.5px;
  letter-spacing: .02em;
}
@media (max-width: 980px) {
  .panels { grid-template-columns: 1fr; }
  .panel { min-height: 0; }
}

@media (max-width: 760px) {
  main { padding-top: 44px; }
  .mark { margin-bottom: 20px; }
  .actions a { grid-template-columns: 3ch 13ch minmax(0, 1fr); }
  .actions .desc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

@media (max-width: 520px) {
  body { font-size: 15px; }
  .topbar { height: 46px; }
  nav { gap: 10px; }
  nav .key { display: none; }
  main { padding: 34px 14px 30px; }
  .mark .bar { width: 26px; height: 48px; }
  .tagline { margin-top: 22px; font-size: 16px; }
  .actions a { grid-template-columns: 3ch 12ch minmax(0, 1fr); padding-left: 4px; padding-right: 4px; }
  .actions .desc { font-size: 12.5px; }
  .panel { min-height: 0; padding: 28px 20px 24px; }
  .wordmark { font-size: clamp(5px, 1.78vw, 8px); }
  .command { gap: 7px; padding: 9px 10px; }
  .command code { font-size: 11.5px; }
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.tui {
  width: min(940px, calc(100vw - 36px));
  height: min(78vh, 720px);
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}
.tui::backdrop { background: rgba(4, 6, 8, .74); backdrop-filter: blur(5px); }
.tui-frame {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0b0d10;
  box-shadow: 0 30px 100px rgba(0, 0, 0, .65);
}
.tui-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border-soft);
  background: #0d1218;
  flex: 0 0 auto;
}
.tui-crumb { color: var(--muted); font-size: 11px; }
.tui-crumb strong { color: var(--accent); font-weight: 500; }
.tui-crumb .sep { color: var(--dim); margin: 0 3px; }
.tui-close {
  margin-left: auto;
  border: 0;
  padding: 3px 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}
.tui-close:hover { color: var(--accent); }
.tui-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--accent-dim) transparent;
  scrollbar-width: thin;
}
.tui-body::-webkit-scrollbar { width: 8px; }
.tui-body::-webkit-scrollbar-thumb { background: var(--accent-dim); border-radius: 4px; }

.doc { max-width: 760px; padding: 30px clamp(20px, 4vw, 38px) 44px; }
.doc-kicker { margin: 0 0 9px; color: var(--accent-dim); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; }
.doc h2 { margin: 0 0 14px; color: var(--accent); font-size: 25px; font-weight: 500; letter-spacing: -.04em; }
.doc h3 { margin: 28px 0 9px; color: #e3e9ee; font-size: 13px; font-weight: 600; }
.doc p { margin: 0 0 12px; color: var(--muted); font-size: 13px; line-height: 1.75; }
.doc a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.doc code { color: #d8e0e7; font-family: var(--mono); font-size: 12px; }
.doc pre {
  margin: 15px 0;
  padding: 13px 15px;
  overflow-x: auto;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: #0d1218;
  color: #d8e0e7;
  font-size: 12px;
  line-height: 1.7;
}
.doc pre code { color: inherit; }
.doc kbd {
  display: inline-block;
  padding: 0 4px;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--accent);
  font: inherit;
  font-size: 11px;
}
.doc-grid { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 0; }
.doc-grid > div { display: grid; grid-template-columns: 10ch minmax(0, 1fr); gap: 10px; font-size: 12px; }
.doc-grid strong { color: var(--accent); font-weight: 500; }
.doc-grid span { color: var(--muted); }
.doc-assets { display: flex; flex-direction: column; margin: 18px 0; border-top: 1px solid var(--border-soft); }
.doc-assets a {
  display: flex;
  justify-content: space-between;
  padding: 9px 2px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}
.doc-assets a:hover { color: var(--accent); }
.doc-note { margin-top: 22px; color: var(--dim) !important; font-size: 11px !important; }
.keys-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px 22px; margin-top: 8px; border-top: 1px solid var(--border-soft); }
.keys-grid > div { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border-soft); color: var(--muted); font-size: 12px; }
.keys-grid kbd { min-width: 3ch; color: var(--accent); font: inherit; }

body.tui-open { overflow: hidden; }

@media (max-width: 520px) {
  .tui { width: 100vw; height: 100dvh; }
  .tui-frame { border-radius: 0; border-left: 0; border-right: 0; }
  .doc { padding: 22px 18px 36px; }
  .doc h2 { font-size: 22px; }
  .keys-grid { grid-template-columns: 1fr; }
  .doc-grid > div { grid-template-columns: 9ch minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

.code-block { position: relative; margin: 15px 0; }
.code-block pre { margin: 0; padding-right: 64px; }
.code-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  margin: 0;
  padding: 2px 6px;
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  background: #0b0d10;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.5;
}
.code-copy:hover { color: var(--accent); border-color: var(--accent-dim); }
