:root {
  color-scheme: dark;
  --background: #061522;
  --surface: #0b2233;
  --surface-raised: #102c40;
  --surface-soft: #15364b;
  --border: #28516a;
  --border-strong: #3f7490;
  --text: #edf7fc;
  --muted: #a9c6d7;
  --blue: #0f8ed8;
  --blue-light: #62c7ff;
  --gold: #ffbf47;
  --green: #5cd49a;
  --red: #ff7c7c;
  --shadow: 0 16px 44px rgb(0 0 0 / 24%);
  font-family: "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 20rem;
  background: var(--background);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 88% 0%, rgb(15 142 216 / 14%), transparent 28rem),
    linear-gradient(180deg, #071927 0, var(--background) 32rem);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
}

a {
  color: var(--blue-light);
  text-underline-offset: 0.2em;
}

a:hover {
  color: #a8e2ff;
}

button,
input {
  font: inherit;
}

button,
.button-link {
  border: 1px solid var(--border-strong);
  border-radius: 0.45rem;
  background: var(--surface-raised);
  color: var(--text);
  cursor: pointer;
}

button:hover,
.button-link:hover {
  border-color: var(--blue-light);
  background: var(--surface-soft);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.site-header {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  min-height: 7rem;
  padding: 1rem clamp(1rem, 2.5vw, 2.75rem);
  border-bottom: 1px solid var(--border);
  background: rgb(5 21 34 / 92%);
}

.site-header img {
  width: 4.1rem;
  height: 4.1rem;
}

.site-header h1,
.site-header p {
  margin: 0;
}

.site-header h1 {
  font-size: clamp(1.55rem, 3vw, 2.3rem);
  line-height: 1.1;
}

.site-header .subtitle {
  max-width: 58rem;
  margin-top: 0.25rem;
  color: var(--muted);
}

.eyebrow {
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-toggle {
  width: 2.65rem;
  height: 2.65rem;
  padding: 0;
  font-size: 1.25rem;
}

.language-switch {
  display: flex;
  gap: 0.35rem;
}

.language-switch a {
  min-width: 2.5rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--border-strong);
  border-radius: 0.4rem;
  color: var(--text);
  text-align: center;
  text-decoration: none;
}

.language-switch a.active {
  border-color: var(--blue);
  background: var(--blue);
}

.page-layout {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  min-height: calc(100vh - 7rem);
  transition: grid-template-columns 160ms ease;
}

.page-layout.nav-collapsed {
  grid-template-columns: 3.8rem minmax(0, 1fr);
}

.site-nav {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: calc(100vh - 7rem);
  padding: 1rem 0.65rem;
  border-right: 1px solid var(--border);
  background: #071b2a;
}

.site-nav button {
  display: block;
  width: 100%;
  margin: 0 0 0.3rem;
  padding: 0.55rem 0.65rem;
  overflow: hidden;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-nav button.active {
  border-color: #216990;
  background: #123a53;
  color: var(--text);
}

.nav-collapsed .site-nav button {
  height: 2.6rem;
  padding: 0;
  color: transparent;
  text-align: center;
}

.nav-collapsed .site-nav button::first-letter {
  color: var(--blue-light);
  font-size: 1.1rem;
}

main {
  min-width: 0;
  padding: clamp(1rem, 2.5vw, 2.5rem);
}

[data-panel][hidden] {
  display: none;
}

.hero,
.panel,
.download-card,
.metric {
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgb(16 44 64 / 96%), rgb(9 31 47 / 96%));
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(18rem, 0.8fr);
  gap: clamp(1.2rem, 3vw, 3rem);
  align-items: center;
  max-width: 92rem;
  padding: clamp(1.4rem, 4vw, 3.8rem);
  border-radius: 1rem;
}

.hero h2 {
  max-width: 20ch;
  margin: 0.25rem 0 0.8rem;
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 0.98;
}

.hero .lead {
  max-width: 64rem;
  color: #c7dfeb;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
}

.hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

.button-link {
  display: inline-block;
  width: fit-content;
  padding: 0.55rem 0.8rem;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.button-link.primary {
  border-color: var(--blue);
  background: var(--blue);
}

.release-seal {
  padding: 1.1rem;
  border: 1px solid var(--border-strong);
  border-radius: 0.8rem;
  background: rgb(4 24 38 / 65%);
}

.release-seal strong {
  display: block;
  color: var(--green);
  font-size: 1.25rem;
}

.release-seal small {
  color: var(--muted);
}

.metric-grid,
.download-grid,
.two-column {
  display: grid;
  gap: 0.85rem;
  max-width: 92rem;
  margin-top: 1rem;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(10rem, 1fr));
}

.download-grid {
  grid-template-columns: repeat(2, minmax(18rem, 1fr));
}

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

.metric,
.download-card,
.panel {
  border-radius: 0.75rem;
}

.metric {
  padding: 1rem;
}

.metric strong {
  display: block;
  color: var(--blue-light);
  font-size: 1.75rem;
}

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

.panel,
.download-card {
  max-width: 92rem;
  margin-top: 1rem;
  padding: clamp(1rem, 2vw, 1.5rem);
}

.panel h2,
.panel h3,
.download-card h2,
.download-card h3 {
  margin-top: 0;
}

.panel p:last-child,
.download-card p:last-child {
  margin-bottom: 0;
}

.panel-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: end;
  justify-content: space-between;
}

.panel-header h2,
.panel-header p {
  margin: 0;
}

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

.download-card .artifact-meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.25rem 0.7rem;
  margin: 0.8rem 0;
}

.artifact-meta dt {
  color: var(--muted);
}

.artifact-meta dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.hash {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.82rem;
}

.notice,
.warning,
.success {
  max-width: 92rem;
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  border-left: 0.3rem solid var(--blue-light);
  background: rgb(10 47 69 / 75%);
}

.warning {
  border-left-color: var(--gold);
}

.success {
  border-left-color: var(--green);
}

.table-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: end;
  margin: 1rem 0 0.55rem;
}

.table-tools label {
  display: grid;
  gap: 0.2rem;
  color: var(--muted);
}

.table-tools input {
  width: min(22rem, 75vw);
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border-strong);
  border-radius: 0.4rem;
  background: #061a29;
  color: var(--text);
}

.table-tools button {
  width: fit-content;
  padding: 0.45rem 0.6rem;
}

.table-stage {
  max-width: none;
  margin: 0;
}

table {
  width: max-content;
  max-width: none;
  border-collapse: collapse;
  table-layout: fixed;
  background: #081e2e;
}

th,
td {
  position: relative;
  min-width: 5rem;
  max-width: 34rem;
  padding: 2px;
  border: 1px solid #2a536b;
  vertical-align: top;
  text-align: left;
  overflow-wrap: anywhere;
}

th {
  height: 2.5rem;
  background: #143b53;
  color: var(--text);
  font-size: 0.83rem;
  user-select: none;
}

th.numeric,
td.numeric {
  text-align: right;
}

th .sort-button {
  width: calc(100% - 0.55rem);
  height: 100%;
  padding: 0.1rem 0.25rem;
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 700;
  text-align: inherit;
}

th[aria-sort="ascending"] .sort-button::after {
  content: " ↑";
}

th[aria-sort="descending"] .sort-button::after {
  content: " ↓";
}

.resize-handle {
  position: absolute;
  z-index: 2;
  top: 0;
  right: -0.2rem;
  width: 0.55rem;
  height: 100%;
  cursor: col-resize;
}

td {
  color: #d5e7ef;
  font-size: 0.82rem;
}

tbody tr:nth-child(even) {
  background: rgb(36 79 101 / 20%);
}

tbody tr:hover {
  background: rgb(24 114 162 / 25%);
}

.nowrap-column {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: normal;
}

.context-menu {
  position: fixed;
  z-index: 100;
  display: grid;
  width: min(22rem, calc(100vw - 1rem));
  max-height: min(34rem, calc(100vh - 1rem));
  padding: 0.45rem;
  overflow-y: auto;
  border: 1px solid var(--border-strong);
  border-radius: 0.55rem;
  background: #082033;
  box-shadow: 0 20px 55px rgb(0 0 0 / 55%);
}

.context-menu[hidden] {
  display: none;
}

.context-menu label,
.context-menu button {
  margin: 0;
  padding: 0.38rem 0.45rem;
}

.context-menu label {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.context-menu button {
  border: 0;
  background: transparent;
  text-align: left;
}

.context-menu hr {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--border);
}

.cli-table {
  width: min(100%, 82rem);
  table-layout: auto;
}

pre,
code {
  font-family: Consolas, "Courier New", monospace;
}

pre {
  max-width: 82rem;
  padding: 0.8rem;
  overflow-wrap: anywhere;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: #04131e;
  white-space: pre-wrap;
}

.version-entry {
  padding: 0.65rem 0;
  border-top: 1px solid var(--border);
}

.version-entry strong {
  color: var(--blue-light);
}

footer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem clamp(1rem, 2.5vw, 2.75rem);
  border-top: 1px solid var(--border);
  background: #04131e;
  color: var(--muted);
}

footer img {
  width: 2.5rem;
  height: 2.5rem;
}

footer p {
  margin: 0;
}

.local-only {
  color: var(--gold);
  font-weight: 700;
}

@media (max-width: 65rem) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(10rem, 1fr));
  }

  .hero,
  .download-grid,
  .two-column {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 48rem) {
  .site-header {
    grid-template-columns: auto auto minmax(0, 1fr);
  }

  .language-switch {
    grid-column: 2 / -1;
  }

  .page-layout,
  .page-layout.nav-collapsed {
    grid-template-columns: 1fr;
  }

  .site-nav {
    position: static;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .nav-collapsed .site-nav {
    display: none;
  }

  .nav-collapsed .site-nav button {
    color: var(--muted);
  }

  main {
    padding: 0.8rem;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  footer {
    grid-template-columns: auto 1fr;
  }

  footer .contact {
    grid-column: 2;
  }
}

@media print {
  .nav-toggle,
  .site-nav,
  .language-switch,
  .table-tools,
  .context-menu {
    display: none !important;
  }

  .page-layout {
    display: block;
  }

  body,
  .panel,
  .hero,
  .download-card,
  .metric {
    background: white;
    color: black;
    box-shadow: none;
  }

  a {
    color: black;
  }
}
