@font-face {
  font-family: "TsangerJinKai02";
  src: url("https://cdn.jsdelivr.net/gh/AlfredoSequeworthy/TsangerJinKai02@main/TsangerJinKai02-W04.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "TsangerJinKai02";
  src: url("https://cdn.jsdelivr.net/gh/AlfredoSequeworthy/TsangerJinKai02@main/TsangerJinKai02-W05.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --parchment: #f5f4ed;
  --ivory: #faf9f5;
  --warm-sand: #e8e6dc;
  --brand: #1b365d;
  --brand-light: #2d5a8a;
  --brand-tint: #eef2f7;
  --near-black: #141413;
  --dark-warm: #3d3d3a;
  --olive: #504e49;
  --stone: #6b6a64;
  --border: #e8e6dc;
  --border-soft: #e5e3d8;
  --line: #d8d5c8;
  --dark-surface: #30302e;
  --serif: "TsangerJinKai02", "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", "STSong", Georgia, serif;
  --sans: var(--serif);
  --mono: "JetBrains Mono", "SF Mono", Consolas, "TsangerJinKai02", "Source Han Serif SC", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background:
    linear-gradient(90deg, #ebe9df 0 1px, transparent 1px) 0 0 / 96px 96px,
    linear-gradient(180deg, #faf9f5 0%, var(--parchment) 42%, #efede3 100%);
  color: var(--near-black);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.58;
  letter-spacing: 0.2px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--brand);
  text-decoration: none;
  border-bottom: 1px solid #d0dce9;
  transition:
    color 160ms ease,
    border-color 160ms ease;
}

a:hover {
  color: var(--brand-light);
  border-bottom-color: var(--brand-light);
}

.page {
  max-width: 1060px;
  margin: 0 auto;
  padding: 76px 64px 112px;
}

.site-header {
  display: flex;
  align-items: center;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border-soft);
}

.company-logo {
  display: block;
  width: 82px;
  height: auto;
}

.hero {
  padding: 54px 0 64px;
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  max-width: 780px;
}

.kicker {
  margin: 0 0 18px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-weight: 500;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  font-size: clamp(44px, 7vw, 76px);
  line-height: 1.08;
  text-wrap: balance;
}

h2 {
  color: var(--near-black);
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.2;
  text-wrap: balance;
}

.lead {
  max-width: 720px;
  margin: 24px 0 0;
  color: var(--dark-warm);
  font-size: 19px;
  line-height: 1.58;
  text-wrap: pretty;
}

.guide {
  position: relative;
}

.step {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 28px;
  padding: 42px 0;
  border-bottom: 1px solid var(--border-soft);
}

.step:last-child {
  border-bottom: 0;
}

.step-marker {
  position: relative;
  display: grid;
  justify-items: center;
}

.step-marker::after {
  content: "";
  position: absolute;
  top: 50px;
  bottom: -42px;
  width: 1px;
  background: var(--line);
}

.step:last-child .step-marker::after {
  display: none;
}

.step-marker span {
  position: sticky;
  top: 28px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  color: var(--brand);
  background: var(--parchment);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
}

.step-content {
  min-width: 0;
  max-width: 100%;
}

.section-head {
  max-width: 760px;
}

.section-head p {
  margin: 12px 0 0;
  color: var(--olive);
  line-height: 1.56;
  text-wrap: pretty;
}

.body-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(340px, 1.08fr);
  gap: 32px;
  align-items: start;
  margin-top: 28px;
  min-width: 0;
}

.body-grid > * {
  min-width: 0;
}

.system-tabs {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(108px, 1fr));
  gap: 4px;
  margin-top: 26px;
  padding: 4px;
  background: #ebe9df;
  border-radius: 10px;
}

.hero-tabs {
  margin-top: 30px;
}

.system-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  min-height: 42px;
  padding: 8px 18px;
  color: var(--olive);
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font: 500 15px/1 var(--serif);
  letter-spacing: 0;
  touch-action: manipulation;
  transition:
    color 160ms ease,
    background 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.system-tab span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-tab svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.system-tab:hover {
  color: var(--brand);
  background: #f5f4ed;
}

.system-tab:active {
  transform: scale(0.96);
}

.system-tab.is-active {
  color: var(--brand);
  background: var(--ivory);
  box-shadow: 0 1px 0 #ffffff inset, 0 8px 18px rgba(27, 54, 93, 0.08);
}

.system-tab:focus-visible {
  outline: 2px solid var(--brand-light);
  outline-offset: 2px;
}

.system-panel {
  max-width: 100%;
  animation: panel-in 180ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.system-panel[hidden] {
  display: none;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.steps {
  margin: 0;
  padding-left: 24px;
  color: var(--dark-warm);
  line-height: 1.62;
}

.steps li + li {
  margin-top: 9px;
}

.code-block {
  position: relative;
  min-width: 0;
  isolation: isolate;
}

.image-panel {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  background: var(--ivory);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  box-shadow: 0 18px 34px rgba(40, 38, 31, 0.08);
}

.image-zoom-trigger {
  display: block;
  width: 100%;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: zoom-in;
}

.image-panel img {
  display: block;
  width: 100%;
  height: auto;
}

.image-zoom-trigger:focus-visible {
  outline: 2px solid var(--brand-light);
  outline-offset: -4px;
}

.image-lightbox {
  width: min(1120px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 52px 16px 16px;
  background: var(--ivory);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  box-shadow: 0 28px 72px rgba(20, 20, 19, 0.28);
}

.image-lightbox::backdrop {
  background: rgba(20, 20, 19, 0.48);
}

.image-lightbox img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 116px);
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--near-black);
  background: var(--parchment);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  cursor: pointer;
}

.lightbox-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.9;
}

.code-block::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: 1;
  height: 43px;
  background:
    radial-gradient(circle at 18px 20px, #d66a5f 0 4px, transparent 4.5px),
    radial-gradient(circle at 32px 20px, #d7af54 0 4px, transparent 4.5px),
    radial-gradient(circle at 46px 20px, #6fa66a 0 4px, transparent 4.5px),
    linear-gradient(180deg, #3b3a37 0%, #343331 100%);
  border: 1px solid #4d4c48;
  border-bottom: 1px solid #4a4945;
  border-radius: 10px 10px 0 0;
  pointer-events: none;
}

.code-block::after {
  content: "terminal";
  position: absolute;
  top: 12px;
  left: 62px;
  z-index: 2;
  color: #b9b7ad;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0;
  pointer-events: none;
}

.copy-button {
  position: absolute;
  top: 7px;
  right: 8px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 29px;
  padding: 5px 10px;
  color: #f1f0e8;
  background: #55544f;
  border: 1px solid #686761;
  border-radius: 6px;
  cursor: pointer;
  font: 500 12px/1 var(--serif);
  letter-spacing: 0;
  touch-action: manipulation;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.copy-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.copy-button .icon-check {
  display: none;
}

.copy-button[data-state="success"] {
  color: #f7f6ef;
  background: #386b4f;
  border-color: #579172;
}

.copy-button[data-state="success"] .icon-copy {
  display: none;
}

.copy-button[data-state="success"] .icon-check {
  display: block;
}

.copy-button:hover {
  background: #62615b;
  border-color: #77766f;
}

.copy-button[data-state="success"]:hover {
  background: #386b4f;
  border-color: #579172;
}

.copy-button:active {
  transform: scale(0.96);
}

.copy-button:focus-visible {
  outline: 2px solid #d0dce9;
  outline-offset: 2px;
}

pre {
  margin: 0;
  padding: 58px 22px 20px;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  color: #f1f0e8;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(180deg, #30302e 0%, #292927 100%);
  border-radius: 10px;
  border: 1px solid #4d4c48;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 18px 34px rgba(40, 38, 31, 0.1);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.68;
  letter-spacing: 0;
}

pre code {
  display: block;
  width: max-content;
  min-width: 100%;
}

code {
  font-family: var(--mono);
}

p code,
li code {
  padding: 2px 6px;
  color: var(--brand);
  background: var(--brand-tint);
  border-radius: 4px;
  white-space: nowrap;
}

a,
pre code {
  overflow-wrap: anywhere;
}

.note-line {
  margin: 22px 0 0;
  padding: 14px 0 0;
  color: var(--olive);
  border-top: 1px solid var(--border-soft);
  line-height: 1.55;
  text-wrap: pretty;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 26px;
  padding-top: 22px;
  color: var(--stone);
  border-top: 1px solid var(--border-soft);
  font-size: 13px;
}

@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;
  }
}

@media (max-width: 880px) {
  .page {
    padding: 60px 28px 88px;
  }

  .body-grid {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .system-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 15px;
  }

  .page {
    padding: 34px 16px 72px;
  }

  .site-header,
  .footer {
    display: grid;
  }

  .company-logo {
    width: 68px;
  }

  .hero {
    padding: 36px 0 42px;
  }

  .lead {
    font-size: 16px;
  }

  .step {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 32px 0;
  }

  .step-marker {
    justify-items: start;
  }

  .step-marker::after {
    display: none;
  }

  .step-marker span {
    position: static;
    width: auto;
    height: auto;
    padding: 3px 8px;
    border-radius: 4px;
  }

  .system-tabs {
    display: flex;
    gap: 4px;
    width: max-content;
    max-width: calc(100vw - 32px);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 4px;
    scrollbar-width: none;
  }

  .system-tabs::-webkit-scrollbar {
    display: none;
  }

  .system-tab {
    flex: 0 0 auto;
    min-height: 40px;
    gap: 5px;
    padding: 8px 12px;
    font-size: 13px;
  }

  .system-tab svg {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
  }

  .code-block {
    max-width: calc(100vw - 32px);
  }

  .image-panel {
    max-width: calc(100vw - 32px);
  }

  pre {
    max-width: calc(100vw - 32px);
    padding: 58px 16px 16px;
    font-size: 13px;
  }

  .copy-button {
    right: 7px;
    padding: 5px 9px;
  }

  pre code {
    width: auto;
    min-width: 0;
    white-space: pre-wrap;
    word-break: break-word;
  }

  .body-grid > div,
  .steps,
  .note-line {
    max-width: calc(100vw - 32px);
  }

  .steps {
    padding-left: 0;
    list-style-position: inside;
  }
}
