:root {
  --bg: #080b10;
  --bg-2: #0c1118;
  --bg-3: #121923;
  --panel: #0b1117;
  --panel-2: #0e151d;
  --panel-3: #111a24;
  --ink: #dde7f1;
  --ink-soft: rgba(221, 231, 241, 0.72);
  --ink-faint: rgba(221, 231, 241, 0.46);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.12);
  --line-no: #586372;
  --green: #8fe388;
  --green-soft: rgba(143, 227, 136, 0.12);
  --red: #ff9580;
  --red-soft: rgba(255, 149, 128, 0.12);
  --yellow: #f0cd75;
  --yellow-soft: rgba(240, 205, 117, 0.12);
  --blue: #86b6ff;
  --blue-soft: rgba(134, 182, 255, 0.12);
  --shadow: 0 20px 48px rgba(0, 0, 0, 0.34);
  --content: 1320px;
  --sans: "Space Grotesk", sans-serif;
  --mono: "IBM Plex Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  font-family: var(--mono);
  background:
    radial-gradient(circle at top, rgba(134, 182, 255, 0.08), transparent 28%),
    linear-gradient(180deg, #080b10 0%, #070a0f 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.024) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.24;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.74), transparent 100%);
}

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

code,
pre,
button {
  font: inherit;
}

.page-shell {
  width: min(calc(100% - 28px), var(--content));
  margin: 0 auto;
  padding: 16px 0 72px;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(8, 11, 16, 0.9);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: #0b1117;
  background: #eef2f7;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 700;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-copy strong,
.topnav,
.language-link,
.button,
.section-title,
.command-card h3 {
  font-family: var(--sans);
}

.brand-copy strong {
  font-size: 0.94rem;
}

.brand-copy span,
.pane-file,
.shell-note,
.section-summary,
.site-footer,
.command-card p,
.path-note,
.legend {
  color: var(--ink-soft);
}

.brand-copy span {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.topnav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  font-size: 0.92rem;
}

.topnav a,
.language-link {
  color: var(--ink-soft);
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.topnav a:hover,
.topnav a:focus-visible,
.language-link:hover,
.language-link:focus-visible {
  color: var(--ink);
}

.language-switch {
  display: flex;
  align-items: center;
  gap: 8px;
}

.language-link {
  min-width: 38px;
  min-height: 34px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.language-link.is-current {
  color: #0b1117;
  border-color: rgba(255, 255, 255, 0.2);
  background: #eef2f7;
}

.terminal-main {
  display: flex;
  flex-direction: column;
  gap: 44px;
  margin-top: 24px;
}

.split-section {
  scroll-margin-top: 100px;
}

.hero-section .section-title {
  max-width: 1120px;
  font-size: clamp(3rem, 6.8vw, 6.4rem);
}

.hero-section .section-summary {
  font-size: 1.08rem;
}

.hero-section .terminal-shell {
  border-color: rgba(143, 227, 136, 0.18);
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.44);
}

.section-intro {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.section-title {
  margin: 0;
  max-width: 980px;
  font-size: clamp(2.3rem, 5vw, 4.8rem);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

.section-summary {
  margin: 0;
  max-width: 760px;
  font-size: 0.96rem;
  line-height: 1.55;
}

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

.button,
.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.button:hover,
.button:focus-visible,
.copy-button:hover,
.copy-button:focus-visible {
  border-color: rgba(255, 255, 255, 0.18);
  background: #111922;
}

.button-primary {
  border-color: rgba(143, 227, 136, 0.32);
  background: rgba(143, 227, 136, 0.08);
  color: #c6f4c2;
}

.button-secondary {
  color: var(--ink-soft);
}

.terminal-shell {
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}

.terminal-dots {
  display: inline-flex;
  gap: 7px;
}

.terminal-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
}

.terminal-title {
  color: var(--ink-soft);
  font-size: 0.84rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pane-grid {
  display: grid;
  grid-template-columns: minmax(0, 48fr) minmax(0, 52fr);
}

.terminal-pane {
  min-width: 0;
  background: var(--panel);
}

.terminal-pane + .terminal-pane {
  border-left: 1px solid var(--line);
}

.pane-raw,
.pane-problem,
.pane-old {
  background: linear-gradient(180deg, rgba(255, 149, 128, 0.05), transparent 40%), var(--panel);
}

.pane-structured,
.pane-guarantee,
.pane-new {
  background: linear-gradient(180deg, rgba(143, 227, 136, 0.05), transparent 40%), var(--panel-2);
}

.pane-install-right {
  background: linear-gradient(180deg, rgba(134, 182, 255, 0.05), transparent 40%), var(--panel-2);
}

.pane-install-full {
  background: linear-gradient(180deg, rgba(134, 182, 255, 0.05), transparent 40%), var(--panel-2);
}

.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.pane-label {
  color: var(--ink);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.pane-file {
  font-size: 0.78rem;
}

.pane-body {
  padding: 0;
}

.code-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: line;
}

.code-lines li {
  display: grid;
  grid-template-columns: 2.8rem 1.2rem minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 2.35rem;
  padding: 6px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.code-lines li::before {
  counter-increment: line;
  content: counter(line);
  color: var(--line-no);
  text-align: right;
}

.line-sign {
  color: var(--line-no);
}

.line-text {
  min-width: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.line-meta {
  background: var(--yellow-soft);
}

.line-meta .line-sign,
.line-meta .line-text {
  color: var(--yellow);
}

.line-add {
  background: var(--green-soft);
}

.line-add .line-sign,
.line-add .line-text {
  color: var(--green);
}

.line-remove {
  background: var(--red-soft);
}

.line-remove .line-sign,
.line-remove .line-text {
  color: var(--red);
}

.line-context .line-text {
  color: var(--ink-soft);
}

.line-plain .line-sign {
  color: transparent;
}

.shell-note,
.legend {
  margin: 10px 4px 0;
  font-size: 0.85rem;
  line-height: 1.6;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.legend span::before {
  display: inline-block;
  margin-right: 8px;
}

.legend-old::before {
  content: "-";
  color: var(--red);
}

.legend-new::before {
  content: "+";
  color: var(--green);
}

.legend-stable::before {
  content: "@";
  color: var(--yellow);
}

.install-shell .pane-body {
  padding: 16px;
}

.install-strip-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.install-strip .section-title {
  max-width: 760px;
}

.install-strip .command-code {
  margin: 0;
}

.install-strip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.command-card,
.path-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-3);
  padding: 16px;
}

.command-card h3,
.path-card h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
}

.command-card p,
.path-card p {
  margin: 8px 0 0;
  font-size: 0.88rem;
  line-height: 1.6;
}

.command-code {
  margin: 14px 0 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  background: #070b10;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.copy-button {
  align-self: flex-start;
  margin-top: 12px;
  min-height: 38px;
  padding: 0 12px;
  font-size: 0.84rem;
}

.copy-button.is-copied {
  border-color: rgba(143, 227, 136, 0.32);
  background: rgba(143, 227, 136, 0.08);
  color: #c6f4c2;
}

.path-list {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--ink-soft);
  line-height: 1.7;
}

.path-list code {
  color: var(--ink);
}

.site-footer {
  display: flex;
  justify-content: flex-start;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 0.84rem;
}

.site-footer p {
  margin: 0;
}

.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 260ms ease, transform 260ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1080px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .topnav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

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

  .terminal-pane + .terminal-pane {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .install-strip-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .install-strip-actions .button,
  .install-strip-actions .copy-button {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(calc(100% - 16px), var(--content));
    padding-top: 10px;
  }

  .topbar {
    padding: 14px;
  }

  .language-switch {
    width: 100%;
    justify-content: flex-start;
  }

  .terminal-main {
    gap: 44px;
    margin-top: 20px;
  }

  .section-title {
    font-size: clamp(1.9rem, 11vw, 2.8rem);
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .button {
    width: 100%;
  }

  .code-lines li {
    grid-template-columns: 2.2rem 1rem minmax(0, 1fr);
    padding: 6px 12px;
    gap: 10px;
  }

  .install-shell .pane-body {
    padding: 12px;
  }

  .command-card,
  .path-card {
    padding: 14px;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .button,
  .copy-button {
    transition: none;
  }
}
