:root {
  --bg: #000;
  --page-bg: #0b0e14;
  --panel: #20222b;
  --surface-strong: #232d45;
  --text: #d7e0ee;
  --line: #2b344e;
  --line-soft: rgba(143, 194, 255, 0.18);
  --accent: #8fd0ff;
  --accent-strong: #52a5ff;
  --primary: #296ad6;
  --primary-hover: #395a89;
  --success: #70e7b6;
  --warning: #ffd19a;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.42);
  --shadow-soft: 0 4px 24px rgba(10, 16, 28, 0.34);
  --radius: 13px;
  --content-width: 1120px;
  --readable-width: 920px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color-scheme: dark;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #000 0%, var(--page-bg) 44%, #000 100%);
  color: var(--text);
  font-family: "Open Sans", "Segoe UI", "SegoeUI", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.62;
  overflow-x: hidden;
}

::selection {
  background: rgba(82, 165, 255, 0.32);
  color: #fff;
}

a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(143, 208, 255, 0.42);
  text-underline-offset: 0.18em;
  transition: color 0.16s ease, text-decoration-color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

a:hover {
  color: #fff;
  text-decoration-color: currentColor;
}

a:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
  border-radius: 6px;
}

.site-header {
  width: calc(100% - 32px);
  max-width: var(--content-width);
  margin: 16px auto 0;
  background: rgba(36, 45, 70, 0.45);
  border: 1px solid rgba(150, 200, 255, 0.19);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
}

.header-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 24px 24px 22px;
}

.brand {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 4px 20px;
  align-items: center;
  margin-bottom: 22px;
  min-width: 0;
}

.brand::before {
  content: "";
  grid-row: 1 / span 2;
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
  background: #25314a70 url("static/LLM-Controller-LOGO.png") center / cover no-repeat;
  border: 1px solid rgba(37, 85, 170, 0.22);
  box-shadow: 0 0 22px 4px rgba(16, 210, 255, 0.34), 0 2px 12px rgba(0, 0, 0, 0.52);
}

.brand h1 {
  margin: 0;
  color: var(--accent);
  font-family: "Courier New", Courier, monospace;
  font-size: clamp(1.55rem, 2.5vw, 2rem);
  font-weight: 700;
  line-height: 1.15;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.brand span {
  display: block;
  max-width: 100%;
  color: #b2d8fe;
  font-size: 1.02rem;
  overflow-wrap: anywhere;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid rgba(98, 131, 184, 0.48);
  border-radius: 7px;
  background: var(--surface-strong);
  color: #d3e3fc;
  font-family: "Segoe UI", "SegoeUI", Arial, sans-serif;
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.nav a:hover {
  background: var(--primary-hover);
  border-color: rgba(104, 166, 255, 0.72);
  color: #fff;
}

.nav a.active {
  background: linear-gradient(90deg, var(--primary) 0%, #43a1f5 100%);
  border-color: rgba(143, 208, 255, 0.76);
  color: #fff;
  box-shadow: 0 3px 14px rgba(18, 68, 145, 0.34);
}

.page {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 32px 20px 58px;
}

.intro {
  max-width: 1120px;
  margin-bottom: 34px;
  padding: 22px 24px;
  background: rgba(24, 28, 38, 0.78);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.intro h2,
.section h2 {
  margin: 0 0 12px;
  color: var(--accent);
  font-family: "Courier New", Courier, monospace;
  font-size: clamp(1.18rem, 2vw, 1.42rem);
  font-weight: 700;
  line-height: 1.25;
}

.intro p,
.section p {
  margin: 0 0 12px;
}

.intro p:last-child,
.section p:last-child {
  margin-bottom: 0;
}

.section {
  margin-top: 36px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.card,
.callout {
  min-width: 0;
  padding: 20px 21px;
  background: var(--panel);
  border: 1px solid rgba(126, 161, 215, 0.22);
  border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.62), 0 1px 8px rgba(17, 17, 17, 0.42);
  color: #c6e3ff;
}

.card h3,
.callout h3 {
  margin: 0 0 13px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(182, 203, 239, 0.2);
  color: #e7efff;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.35;
}

.card p,
.callout p {
  margin: 0 0 12px;
  color: #c6d9f2;
  line-height: 1.58;
}

.card > a:last-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-height: 38px;
  margin-top: 4px;
  padding: 8px 14px;
  border: 1px solid rgba(98, 131, 184, 0.52);
  border-radius: 7px;
  background: var(--surface-strong);
  color: #d3e3fc;
  font-family: "Segoe UI", "SegoeUI", Arial, sans-serif;
  font-size: 0.96rem;
  font-weight: 600;
  text-decoration: none;
}

.card > a:last-child:hover {
  background: var(--primary-hover);
  border-color: rgba(104, 166, 255, 0.72);
  color: #fff;
}

.card ul,
.callout ul,
.section ul {
  margin: 8px 0 0;
  padding-left: 21px;
}

.card li,
.callout li,
.section li {
  margin: 6px 0;
  overflow-wrap: anywhere;
}

li::marker {
  color: var(--accent);
}

.callout {
  background: linear-gradient(95deg, #232b3d 0%, #273c62 100%);
  border-left: 4px solid #3d86f6;
}

.callout.ok {
  background: linear-gradient(95deg, rgba(25, 55, 42, 0.94) 0%, rgba(29, 78, 58, 0.94) 100%);
  border-left-color: var(--success);
}

.callout.warn {
  background: linear-gradient(95deg, rgba(31, 42, 61, 0.96) 0%, rgba(42, 52, 72, 0.96) 100%);
  border-left-color: var(--warning);
}

.callout.warn h3 {
  color: #ffe2aa;
  border-bottom-color: rgba(255, 209, 154, 0.22);
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.fact {
  min-width: 0;
  padding: 14px 16px;
  background: rgba(24, 28, 38, 0.86);
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  color: #c6d9f2;
  overflow-wrap: anywhere;
}

.fact strong {
  display: block;
  margin-bottom: 5px;
  color: #e7efff;
  font-weight: 600;
}

.list-heading {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

code {
  padding: 2px 6px;
  background: #181c2a;
  border: 1px solid #263042;
  border-radius: 5px;
  color: #e0f1ff;
  font-family: "Fira Mono", Consolas, "Courier New", monospace;
  font-size: 0.92em;
  overflow-wrap: anywhere;
}

table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  border-spacing: 0;
  background: rgba(14, 22, 34, 0.78);
  box-shadow: var(--shadow-soft);
}

thead,
tbody {
  display: table;
  width: 100%;
  min-width: 660px;
  table-layout: fixed;
  border-spacing: 0;
}

th,
td {
  padding: 13px 15px;
  border-bottom: 1px solid rgba(123, 175, 255, 0.12);
  color: #d7e0ee;
  text-align: left;
  vertical-align: top;
}

th {
  background: #273348;
  color: #a7d8ff;
  font-weight: 600;
}

tbody tr:hover td {
  background: rgba(35, 47, 73, 0.52);
}

tr:last-child td {
  border-bottom: 0;
}

.feature-matrix thead,
.feature-matrix tbody {
  min-width: 820px;
}

.feature-matrix th,
.feature-matrix td {
  padding: 10px 12px;
  font-size: 0.94rem;
  line-height: 1.42;
}

.feature-matrix th:nth-child(1),
.feature-matrix td:nth-child(1) {
  width: 18%;
}

.feature-matrix th:nth-child(2),
.feature-matrix td:nth-child(2) {
  width: 27%;
}

.feature-matrix th:nth-child(3),
.feature-matrix td:nth-child(3) {
  width: 25%;
}

.feature-matrix th:nth-child(4),
.feature-matrix td:nth-child(4) {
  width: 30%;
}

.feature-matrix td:first-child {
  color: #e7efff;
  font-weight: 600;
}

.footer-note {
  margin: 42px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: #7db2ec;
  font-size: 0.95rem;
  text-align: center;
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
  background: #161822;
}

::-webkit-scrollbar-thumb {
  background: #28344a;
  border: 2px solid #161822;
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3c5580;
}

@media (max-width: 760px) {
  .site-header {
    width: calc(100% - 24px);
    margin-top: 12px;
  }

  .header-inner {
    padding: 20px 16px 18px;
  }

  .brand {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 4px 14px;
    margin-bottom: 18px;
  }

  .brand::before {
    width: 54px;
    height: 54px;
  }

  .brand h1 {
    font-size: 1.34rem;
  }

  .brand span {
    font-size: 0.96rem;
  }

  .nav {
    gap: 8px;
  }

  .nav a {
    flex: 1 1 calc(50% - 8px);
    min-height: 44px;
    padding: 9px 10px;
  }

  .page {
    padding: 24px 12px 44px;
  }

  .intro,
  .card,
  .callout {
    padding: 17px;
  }

  .grid,
  .facts,
  .two-col {
    grid-template-columns: 1fr;
  }

  thead,
  tbody {
    min-width: 620px;
  }

  th,
  td {
    padding: 11px 12px;
  }
}

@media (max-width: 520px) {
  .brand {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .brand::before {
    grid-row: auto;
  }

  .brand h1 {
    font-size: 1.14rem;
  }

  .nav a {
    flex-basis: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
