:root {
  --bg: #0d1117;
  --bg-elev: #161b22;
  --bg-line: #1f2630;
  --text: #e6edf3;
  --text-dim: #8b949e;
  --text-faint: #545d68;
  --accent: #58a6ff;
  --accent-warm: #f0883e;
  --accent-green: #3fb950;
  --border: #30363d;
  --border-soft: #21262d;
  --sidebar-w: 320px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--bg-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-line) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.4;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}

.mono { font-family: "JetBrains Mono", monospace; }

a { color: inherit; text-decoration: none; }

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

aside {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  border-right: 1px solid var(--border);
  background: var(--bg-elev);
  padding: 56px 32px 40px;
  display: flex;
  flex-direction: column;
  z-index: 10;
  overflow-y: auto;
}

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  margin-bottom: 48px;
}
.status .pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.5);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.5); }
  70% { box-shadow: 0 0 0 10px rgba(63, 185, 80, 0); }
  100% { box-shadow: 0 0 0 0 rgba(63, 185, 80, 0); }
}

.identity { margin-bottom: 48px; }
.identity .handle {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 12px;
}
.identity h1 {
  font-family: "Inter", sans-serif;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 6px;
}
.identity .role {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.5;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  margin-bottom: 32px;
  color: var(--text-faint);
}
.lang-switch a {
  color: var(--text-dim);
  padding: 2px 6px;
  border: 1px solid transparent;
  border-radius: 4px;
  transition: color 0.15s, border-color 0.15s;
}
.lang-switch a:hover { color: var(--text); }
.lang-switch a.active {
  color: var(--accent);
  border-color: var(--border);
}
.lang-switch .sep { color: var(--text-faint); }

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: auto;
}
.side-nav a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  color: var(--text-dim);
  border-radius: 6px;
  position: relative;
  transition: all 0.2s;
}
.side-nav a .glyph {
  color: var(--text-faint);
  transition: color 0.2s;
}
.side-nav a:hover,
.side-nav a.active {
  color: var(--text);
  background: var(--bg-line);
}
.side-nav a:hover .glyph,
.side-nav a.active .glyph {
  color: var(--accent);
}
.side-nav a .num {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-faint);
}

.side-meta {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}
.meta-row .k { color: var(--text-faint); }
.meta-row .v { color: var(--text-dim); }
.meta-row a.v:hover { color: var(--accent); }

main {
  grid-column: 2;
  padding: 80px 80px 80px;
  max-width: 1100px;
}

section {
  padding: 80px 0;
  scroll-margin-top: 40px;
  position: relative;
}
section:first-child { padding-top: 0; }
section + section {
  border-top: 1px solid var(--border-soft);
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 40px;
  font-family: "JetBrains Mono", monospace;
}
.section-header .marker {
  color: var(--accent);
  font-size: 13px;
}
.section-header .crumb {
  font-size: 13px;
  color: var(--text-faint);
}
.section-header .crumb .sep {
  margin: 0 8px;
  color: var(--border);
}
.section-header .crumb .current { color: var(--text); }

.hero { padding: 40px 0 80px !important; }
.hero-intro {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero-intro .prompt { color: var(--accent-green); }

.hero h2 {
  font-family: "Inter", sans-serif;
  font-weight: 300;
  font-size: clamp(40px, 5vw, 62px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 36px;
  max-width: 18ch;
}
.hero h2 strong {
  font-weight: 600;
  color: var(--text);
}
.hero h2 .hl {
  color: var(--accent);
  font-weight: 400;
}
.hero h2 .cursor {
  display: inline-block;
  width: 4px;
  height: 0.85em;
  background: var(--accent);
  margin-left: 6px;
  transform: translateY(2px);
  animation: blink 1.1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-sub {
  font-size: 17px;
  color: var(--text-dim);
  max-width: 56ch;
  line-height: 1.7;
  margin-bottom: 48px;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-elev);
}
.kpi {
  padding: 24px 28px;
  border-right: 1px solid var(--border);
  position: relative;
}
.kpi:last-child { border-right: none; }
.kpi .val {
  font-family: "JetBrains Mono", monospace;
  font-size: 32px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.kpi .val .unit { color: var(--accent); }
.kpi .lbl {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--bg-line);
  border-bottom: 1px solid var(--border);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--text-dim);
}
.card-head .dots { display: flex; gap: 6px; }
.card-head .dots span {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--border);
}
.card-head .dots span:nth-child(1) { background: #ff5f57; }
.card-head .dots span:nth-child(2) { background: #febc2e; }
.card-head .dots span:nth-child(3) { background: #28c840; }
.card-head .filename {
  margin-left: 10px;
  color: var(--text);
}
.card-head .filename .ext { color: var(--text-faint); }

.card-body { padding: 36px 44px; }

.doc-h1 {
  font-family: "Inter", sans-serif;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.doc-h1::before {
  content: "#";
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-weight: 400;
}
.doc-sub {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 28px;
}

.doc-body p {
  color: var(--text-dim);
  line-height: 1.75;
  margin-bottom: 18px;
  max-width: 68ch;
}
.doc-body p strong {
  color: var(--text);
  font-weight: 500;
}
.doc-body p code,
.doc-body p .code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.88em;
  background: var(--bg-line);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border-soft);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.badge {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 4px;
  background: var(--bg-line);
  color: var(--text-dim);
  border: 1px solid var(--border-soft);
}
.badge .k { color: var(--text-faint); margin-right: 6px; }
.badge .v { color: var(--accent); }

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stack-row {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 32px;
  align-items: center;
  transition: all 0.25s ease;
}
.stack-row:hover {
  border-color: var(--accent);
  transform: translateX(4px);
}
.stack-row .layer-name {
  display: flex;
  align-items: center;
  gap: 12px;
}
.stack-row .layer-idx {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--text-faint);
  background: var(--bg-line);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-soft);
}
.stack-row .layer-title {
  font-family: "Inter", sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}
.stack-row .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.chip.primary {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(88, 166, 255, 0.08);
}
.chip:hover {
  color: var(--text);
  border-color: var(--text-dim);
}
.stack-row .count {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--text-faint);
}

.contact-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 40px 44px;
}

.contact-lead {
  font-family: "Inter", sans-serif;
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 300;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 40px;
  max-width: 28ch;
  letter-spacing: -0.015em;
}
.contact-lead em {
  font-style: normal;
  color: var(--accent);
  font-weight: 400;
}

form.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 28px;
}
.field { position: relative; }
.field.full { grid-column: 1 / -1; }
.field label {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.field label .req { color: var(--accent-warm); margin-left: 4px; }
.field input,
.field textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: all 0.2s;
  resize: vertical;
}
.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}
.field textarea { min-height: 120px; }

button.submit-btn {
  margin-top: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  padding: 13px 28px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  cursor: pointer;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  transition: all 0.2s;
}
button.submit-btn:hover {
  background: var(--text);
  transform: translateY(-1px);
}
button.submit-btn .arrow {
  transition: transform 0.2s;
}
button.submit-btn:hover .arrow {
  transform: translateX(3px);
}

.form-status {
  grid-column: 1 / -1;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--accent-green);
}
.form-status:empty { display: none; }

footer.site-footer {
  margin-top: 80px;
  padding-top: 32px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--text-faint);
}
footer.site-footer a:hover { color: var(--accent); }

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 1024px) {
  :root { --sidebar-w: 280px; }
  main { padding: 60px 48px; }
  .card-body, .contact-card { padding: 28px; }
  .stack-row { grid-template-columns: 1fr; gap: 16px; }
  .stack-row .count { display: none; }
}

.burger {
  display: none;
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  z-index: 20;
}
.burger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
aside.open .burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
aside.open .burger span:nth-child(2) { opacity: 0; }
aside.open .burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
  .layout { grid-template-columns: 1fr; }
  aside {
    position: relative;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 24px;
  }
  .burger { display: flex; }
  .identity { margin-bottom: 24px; }
  footer.site-footer { margin-top: 0; }
  .lang-switch,
  .side-nav,
  .side-meta { display: none; }
  aside.open .lang-switch { display: flex; margin-top: 24px; }
  aside.open .side-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 16px;
    margin-bottom: 0;
  }
  aside.open .side-meta { display: flex; margin-top: 24px; }
  main {
    grid-column: 1;
    padding: 32px 24px;
  }
  section { padding: 48px 0; }
  .hero { padding: 16px 0 48px !important; }
  .kpi-row { grid-template-columns: 1fr; }
  .kpi { border-right: none; border-bottom: 1px solid var(--border); }
  .kpi:last-child { border-bottom: none; }
  form.contact-form { grid-template-columns: 1fr; }
  .card-body { padding: 24px; }
  .contact-card { padding: 24px; }
}
