:root {
  color-scheme: dark;
  --bg: #05070b;
  --panel: rgba(13, 20, 30, 0.74);
  --panel-strong: rgba(7, 12, 19, 0.92);
  --line: rgba(125, 211, 252, 0.2);
  --line-strong: rgba(125, 211, 252, 0.5);
  --text: #eaf5ff;
  --muted: #9aabbc;
  --dim: #657789;
  --cyan: #67e8f9;
  --amber: #f7c476;
  --green: #86efac;
  --red: #fb7185;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 8%, rgba(103, 232, 249, 0.14), transparent 34%),
    radial-gradient(circle at 88% 14%, rgba(247, 196, 118, 0.1), transparent 30%),
    linear-gradient(180deg, #070b10 0%, #08111d 45%, #020409 100%);
  color: var(--text);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  line-height: 1.75;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(125, 211, 252, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 211, 252, 0.055) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.92), transparent 82%);
}

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

.shell {
  position: relative;
  z-index: 1;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(3, 7, 12, 0.72);
  backdrop-filter: blur(18px);
}

.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(103, 232, 249, 0.35);
  background: rgba(103, 232, 249, 0.08);
  color: var(--cyan);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
}

.brand-title,
.brand-subtitle,
.nav-links,
.kicker,
.eyebrow,
.toc-title,
.button,
.flow-number,
.chip,
.footer {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.brand-title {
  display: block;
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: #f8fbff;
  white-space: nowrap;
}

.brand-subtitle {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.nav-links a:hover {
  color: var(--cyan);
}

.language-toggle {
  height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.035);
  color: #d8eefc;
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.i18n-en {
  display: none;
}

html[data-site-language='en'] .i18n-zh {
  display: none;
}

html[data-site-language='en'] .i18n-en {
  display: inline;
}

html[data-site-language='zh'] .i18n-zh {
  display: inline;
}

html[data-site-language='zh'] .i18n-en {
  display: none;
}

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 34px 20px 72px;
}

.hero-card {
  position: relative;
  min-height: 680px;
  overflow: hidden;
  border: 1px solid rgba(103, 232, 249, 0.18);
  background: #070b10;
  box-shadow: 0 30px 120px rgba(0, 0, 0, 0.45);
}

.hero-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.78;
}

.hero-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(4, 7, 12, 0.92) 0%, rgba(4, 7, 12, 0.72) 36%, transparent 82%),
    linear-gradient(180deg, rgba(4, 7, 12, 0.1), rgba(4, 7, 12, 0.88));
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 790px;
  padding: clamp(26px, 5vw, 58px);
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(103, 232, 249, 0.24);
  background: rgba(103, 232, 249, 0.06);
  color: #bcf6ff;
  padding: 8px 10px;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--cyan);
  box-shadow: 0 0 20px rgba(103, 232, 249, 0.9);
}

h1 {
  margin: 34px 0 0;
  max-width: 880px;
  font-size: clamp(42px, 7vw, 88px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  font-weight: 750;
}

.hero-lead {
  margin: 28px 0 0;
  max-width: 720px;
  color: #d2e8f6;
  font-size: clamp(18px, 2.2vw, 24px);
  line-height: 1.65;
}

.hero-note {
  margin: 18px 0 0;
  max-width: 700px;
  color: var(--muted);
  font-size: 15px;
}

.hero-actions {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(103, 232, 249, 0.55);
  background: var(--cyan);
  color: #061018;
  padding: 0 18px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.button.secondary {
  color: #d7e8f3;
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.14);
}

.article-grid {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px 110px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  gap: 34px;
}

.article {
  min-width: 0;
}

.aside {
  position: sticky;
  top: 86px;
  align-self: start;
}

.toc,
.source-box,
.section-card,
.quote-band,
.diagram,
.callout,
.matrix,
.manifesto {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

.toc,
.source-box {
  padding: 18px;
}

.toc-title,
.eyebrow {
  color: var(--cyan);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.toc a {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.toc a:hover {
  color: #fff;
}

.source-box {
  margin-top: 14px;
}

.source-box p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.source-box a {
  color: #d8f8ff;
  border-bottom: 1px solid rgba(103, 232, 249, 0.35);
}

section {
  scroll-margin-top: 96px;
}

.section-card {
  margin-top: 22px;
  padding: clamp(22px, 4vw, 42px);
}

h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.015em;
}

h3 {
  margin: 28px 0 10px;
  color: #f5fbff;
  font-size: 22px;
  line-height: 1.3;
}

p {
  margin: 18px 0 0;
  color: #c1cedb;
  font-size: 17px;
}

strong {
  color: #fff;
}

.lead {
  margin-top: 18px;
  color: #dcefff;
  font-size: 20px;
  line-height: 1.75;
}

.quote-band {
  position: relative;
  margin: 28px 0;
  padding: clamp(20px, 4vw, 34px);
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(103, 232, 249, 0.11), rgba(247, 196, 118, 0.05)),
    rgba(6, 12, 20, 0.84);
}

.quote-band::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(var(--cyan), var(--amber));
}

.quote-band blockquote {
  margin: 0;
  color: #fff;
  font-size: clamp(23px, 3.2vw, 38px);
  line-height: 1.25;
  letter-spacing: -0.012em;
  font-weight: 750;
}

.quote-band cite {
  display: block;
  margin-top: 16px;
  color: var(--muted);
  font-style: normal;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.diagram {
  margin: 34px 0;
  padding: 24px;
  overflow: hidden;
}

.compiler-flow {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 12px;
  align-items: stretch;
}

.flow-stack {
  display: grid;
  gap: 10px;
}

.flow-cell,
.compiler-core {
  border: 1px solid rgba(103, 232, 249, 0.18);
  background: rgba(4, 10, 17, 0.76);
  padding: 16px;
}

.compiler-core {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 280px;
  border-color: rgba(247, 196, 118, 0.34);
  background:
    radial-gradient(circle at 50% 45%, rgba(247, 196, 118, 0.18), transparent 42%),
    rgba(4, 10, 17, 0.82);
}

.flow-number {
  color: var(--amber);
  font-size: 11px;
  letter-spacing: 0.18em;
}

.flow-title {
  margin-top: 10px;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

.flow-body {
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.core-title {
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
}

.core-body {
  margin-top: 16px;
  color: #cce5f3;
  font-size: 15px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.chip {
  border: 1px solid rgba(103, 232, 249, 0.2);
  background: rgba(103, 232, 249, 0.07);
  padding: 6px 8px;
  color: #d8faff;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.mini-card {
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(0, 0, 0, 0.18);
  padding: 18px;
}

.mini-card h3 {
  margin: 0;
  font-size: 18px;
}

.mini-card p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.mini-card.good {
  border-color: rgba(134, 239, 172, 0.24);
}

.mini-card.warn {
  border-color: rgba(247, 196, 118, 0.24);
}

.callout {
  margin: 28px 0;
  padding: 24px;
  border-color: rgba(247, 196, 118, 0.22);
  background: rgba(247, 196, 118, 0.055);
}

.callout p {
  margin: 0;
  color: #ffe6bd;
}

.matrix {
  margin: 30px 0;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  padding: 14px;
  vertical-align: top;
  text-align: left;
}

th {
  color: #dff9ff;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

td {
  color: #c1cedb;
  font-size: 14px;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.source-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.18);
  padding: 18px;
}

.source-card a {
  color: #fff;
  border-bottom: 1px solid rgba(103, 232, 249, 0.35);
}

.source-card p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.manifesto {
  margin-top: 34px;
  padding: clamp(24px, 4vw, 42px);
  background:
    linear-gradient(135deg, rgba(103, 232, 249, 0.08), rgba(134, 239, 172, 0.04)),
    rgba(5, 11, 18, 0.88);
}

.manifesto ul {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.manifesto li {
  position: relative;
  padding-left: 22px;
  color: #d6e5f1;
}

.manifesto li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 13px;
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--cyan);
  box-shadow: 0 0 14px rgba(103, 232, 249, 0.75);
}

.footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px 50px;
  color: var(--dim);
  font-size: 13px;
}

@media (max-width: 980px) {
  .article-grid {
    grid-template-columns: 1fr;
  }

  .aside {
    position: static;
    order: -1;
  }

  .compiler-flow {
    grid-template-columns: 1fr;
  }

  .compiler-core {
    min-height: auto;
  }
}

@media (max-width: 720px) {
  .nav-links {
    display: none;
  }

  .hero {
    padding-top: 16px;
  }

  .hero-card {
    min-height: 760px;
  }

  .hero-card img {
    object-position: 58% center;
    opacity: 0.55;
  }

  .hero-content {
    padding: 24px;
  }

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

.flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.flow-node {
  position: relative;
  min-height: 138px;
  padding: 18px;
  border: 1px solid rgba(103, 232, 249, 0.18);
  background: rgba(4, 10, 17, 0.76);
}

.flow-node:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -10px;
  width: 10px;
  height: 1px;
  background: var(--line-strong);
}

@media (max-width: 980px) {
  .flow {
    grid-template-columns: 1fr;
  }

  .flow-node:not(:last-child)::after {
    top: auto;
    right: 50%;
    bottom: -10px;
    width: 1px;
    height: 10px;
  }
}
