:root {
  --bg: #272727;
  --bg-soft: #2f2f2f;
  --panel: #2b2b2b;
  --text: #ededed;
  --muted: #c2c2c2;
  --line: #5e5e5e;
  --line-strong: #8f8f8f;
  --accent: #9a9a9a;
  --accent-soft: #3f3f3f;
  --button-text: #f2f2f2;
  --button-bg: #313131;
  --button-border: #8f8f8f;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

a {
  color: var(--text);
}

.container {
  width: min(1700px, 98vw);
  margin: 0 auto;
}

.site-header {
  border-bottom: 2px solid var(--line-strong);
  background: var(--bg-soft);
}

.site-header .container {
  width: min(1700px, 98vw);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.8rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.72rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-right: auto;
}

.brand-logo {
  width: 44px;
  height: 44px;
  display: block;
  object-fit: contain;
  image-rendering: auto;
  backface-visibility: hidden;
}

.brand-title {
  font-size: 1.42rem;
  font-weight: 800;
  line-height: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.nav-links a,
.lang-link,
.btn {
  border: 2px solid var(--button-border);
  background: var(--button-bg);
  color: var(--button-text);
  text-decoration: none;
  padding: 0.45rem 0.7rem;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  position: relative;
  min-height: 41px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 120ms ease, transform 120ms ease;
}

#downloads .btn::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 9px;
  height: 9px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0));
}

#downloads .btn.no-corner::after {
  content: none;
}

.nav-links a:hover,
.lang-link:hover,
.btn:hover {
  background: var(--accent-soft);
}

.nav-links a:active,
.lang-link:active,
.btn:active {
  transform: translate(1px, 1px);
}

.nav-links a.current {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.site-main {
  padding: 1.8rem 0 2.6rem;
}

.layout-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(430px, 480px);
  gap: 2.2rem;
  align-items: start;
}

.layout-left,
.layout-right {
  display: grid;
  gap: 1rem;
}

.layout-left {
  min-width: 0;
  overflow: hidden;
}

.layout-right {
  min-width: 0;
  justify-self: end;
  margin-top: 0;
}

.layout-board .section {
  margin-top: 0;
}

.hero {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #2d2d2d 0%, #2a2a2a 100%);
  padding: 1.4rem;
  margin-bottom: 0;
}

.hero h1 {
  margin: 0;
  line-height: 1.2;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.hero-banner-top {
  margin: 0 0 0.85rem;
}

.hero-banner-top img {
  width: min(100%, 560px);
  height: auto;
  display: block;
}

.hero p {
  color: var(--muted);
  font-size: 1.04rem;
  margin: 0.7rem 0 0;
}

.hero-actions {
  display: flex;
  gap: 0.7rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
}

.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 1rem;
}

.panel-philosophy {
  background: transparent;
}

.panel-philosophy p {
  max-width: 92ch;
}

.panel-quickstart {
  background: #2a2a2a;
}

.panel h2 {
  margin: 0 0 0.6rem;
  font-size: 1.2rem;
}

.panel p,
.panel li {
  color: var(--muted);
}

.section {
  margin-top: 1rem;
}

.section-downloads {
  max-width: none;
  margin: 0.55rem 0 0;
}

.layout-left .section-downloads {
  width: calc(100% - 6.59rem);
  max-width: calc(100% - 6.59rem);
  margin-right: 0;
  overflow: hidden;
}

.stack-panels {
  display: grid;
  gap: 1rem;
}

.panel pre + pre {
  margin-top: 0.7rem;
}

.features-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.feature-card {
  border: 1px solid var(--line);
  padding: 0.8rem;
  background: var(--panel);
}

.feature-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
}

pre {
  margin: 0;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  padding: 0.75rem;
  overflow-x: auto;
}

code {
  font-family: "IBM Plex Mono", "Fira Code", Consolas, monospace;
  font-size: 0.9rem;
}

.downloads-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.download-card {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 0.8rem;
}

.download-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.5rem;
}

.download-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0.6rem;
}

.social {
  display: flex;
  gap: 0.6rem;
}

.social a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.icon {
  width: 20px;
  height: 20px;
  display: block;
  flex: 0 0 auto;
  fill: currentColor;
}

.icon-sm {
  width: 16px;
  height: 16px;
}

.icon-linux {
  width: 24px;
  height: 24px;
}

.site-footer {
  border-top: 2px solid var(--line-strong);
  margin-top: 1.6rem;
  padding: 1rem 0 1.6rem;
  background: var(--bg-soft);
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.muted {
  color: var(--muted);
}

.page-centered .hero,
.page-centered .panel {
  text-align: center;
}

.page-centered .hero {
  width: min(1120px, 94vw);
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.page-centered .section.container {
  width: min(1120px, 94vw);
}

.page-centered .hero-actions {
  justify-content: flex-start;
}

.page-centered .features-grid,
.page-centered .downloads-grid {
  max-width: 1120px;
  margin: 0 auto;
}

.downloads-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.downloads-page .site-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.downloads-page #downloads {
  margin-top: 1rem;
}

.page-centered #features .feature-card {
  min-height: 250px;
}

.page-centered #features .feature-card pre {
  margin-top: 0.6rem;
  padding: 0.6rem 0.7rem;
}

.page-centered #features .feature-card code {
  font-size: 0.86rem;
  line-height: 1.45;
}

.page-centered .download-head {
  justify-content: center;
}

.page-centered .download-meta {
  text-align: center;
}

.docs-version-row {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.docs-version-select {
  border: 2px solid var(--button-border);
  background: var(--button-bg);
  color: var(--button-text);
  padding: 0.4rem 0.55rem;
  font-size: 0.88rem;
  font-weight: 700;
}

.doc-badge {
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--muted);
  padding: 0.25rem 0.45rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.docs-grid {
  display: grid;
  gap: 1rem;
}

.docs-grid-large {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.doc-card {
  min-height: 190px;
}

.docs-features-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.docs-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.docs-page .site-main {
  flex: 1;
}

.docs-content p {
  margin: 0;
  line-height: 1.46;
}

.docs-content p + p {
  margin-top: 0.45rem;
}

.docs-content h3 {
  margin: 1rem 0 0.5rem;
  font-size: 1rem;
}

.docs-content ul {
  margin: 0.4rem 0 0;
  padding-left: 1.25rem;
}

.docs-content li + li {
  margin-top: 0.35rem;
}

.docs-search-label {
  display: block;
  margin: 0.8rem 0 0.35rem;
  color: var(--muted);
  font-weight: 700;
}

.docs-search-input {
  width: 100%;
  border: 2px solid var(--button-border);
  background: var(--bg-soft);
  color: var(--text);
  padding: 0.7rem 0.8rem;
  font: inherit;
}

.docs-search-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.docs-search-meta {
  margin-top: 0.55rem;
  font-size: 0.9rem;
}

.docs-search-results {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.docs-search-result {
  display: grid;
  gap: 0.25rem;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  padding: 0.75rem;
  text-decoration: none;
}

.docs-search-result:hover {
  background: var(--accent-soft);
}

.docs-search-section {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.docs-search-result small {
  color: var(--muted);
  line-height: 1.45;
}

.docs-search-result mark {
  background: #665c54;
  color: #fbf1c7;
  padding: 0 0.12rem;
}

.docs-home .site-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (max-width: 860px) {
  .downloads-page .site-main {
    display: block;
  }

  .layout-board {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .layout-left,
  .layout-right {
    max-width: none;
  }

  .layout-right {
    justify-self: stretch;
    margin-top: 0;
  }

  .layout-left .section-downloads {
    width: 100%;
    max-width: none;
    margin-right: 0;
  }

  .header-row {
    align-items: flex-start;
  }

  .nav-links {
    width: 100%;
    justify-content: flex-start;
  }

  .hero {
    padding: 1rem;
  }

  .hero-banner-top img {
    width: min(100%, 480px);
  }

  .split,
  .docs-grid-large,
  .docs-features-grid,
  .features-grid,
  .downloads-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .container {
    width: min(100%, 94vw);
  }

  .site-main {
    padding-top: 1.1rem;
  }

  .brand-logo {
    width: 36px;
    height: 36px;
  }

  .brand-title {
    font-size: 1.18rem;
  }

  .hero h1 {
    font-size: 1.55rem;
  }

  .hero p {
    font-size: 0.96rem;
  }

  .nav-links a,
  .lang-link,
  .btn {
    font-size: 0.82rem;
    padding: 0.42rem 0.58rem;
  }

  .download-card,
  .feature-card,
  .panel {
    padding: 0.8rem;
  }
}
