@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@300;400;500;600;700&family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

:root {
  --ink: #000000;
  --paper: #ffffff;
  --pad: clamp(1.1rem, 4vw, 3rem);
  --max: 1140px;
  --font: 'Space Grotesk', 'Archivo', system-ui, -apple-system, 'Segoe UI', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
  font-weight: 400;
}

a { color: var(--ink); }

a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.topstrip {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .3rem 1rem;
  padding: .55rem var(--pad);
  border-bottom: 2px solid var(--ink);
  font-size: 15px;
  letter-spacing: .16em;
  line-height: 1.5;
}

.ts-kw { opacity: .6; }

.bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .4rem 1rem;
  padding: 1rem var(--pad);
  border-bottom: 4px solid var(--ink);
}

.brand {
  font-size: clamp(1.1rem, 2.4vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -.03em;
  text-decoration: none;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: .4rem .6rem;
  white-space: nowrap;
}

.brand:hover { background: var(--ink); color: var(--paper); }

.m {
  display: flex;
  align-items: center;
  gap: .5rem .9rem;
  flex-wrap: wrap;
  min-width: 0;
}

.m summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: .4rem .1rem;
  font-size: 15px;
  letter-spacing: .16em;
  font-weight: 600;
  border-bottom: 3px solid var(--ink);
  user-select: none;
}

.m summary::-webkit-details-marker { display: none; }

.m[open] summary { border-bottom-color: var(--ink); }
.m summary:hover { background: var(--ink); color: var(--paper); }

.m-list {
  display: flex;
  flex-wrap: wrap;
  gap: .1rem .9rem;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
}

.m-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: .4rem .1rem;
  font-size: 15px;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.m-list a:hover { border-bottom-color: var(--ink); }

.m-end { justify-content: flex-end; }
.m-end summary { order: 3; }

.anchors {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--ink);
  color: var(--paper);
  border-bottom: 3px solid var(--ink);
}

.anchors ul {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
}

.anchors ul::-webkit-scrollbar { display: none; }

.anchors a {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: .7rem 1rem;
  color: var(--paper);
  text-decoration: none;
  font-size: 15px;
  letter-spacing: .08em;
  white-space: nowrap;
  border-right: 1px solid rgba(255, 255, 255, .3);
  transition: background .15s linear, color .15s linear;
}

.anchors a:hover,
.anchors a:focus-visible {
  background: var(--paper);
  color: var(--ink);
}

.hero {
  position: relative;
  min-height: 45vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  padding: clamp(2.4rem, 7vw, 4.5rem) var(--pad);
  text-align: center;
  border-bottom: 4px solid var(--ink);
  overflow: hidden;
  background-image: radial-gradient(rgba(0, 0, 0, .38) 1px, transparent 1px);
  background-size: 16px 16px;
  background-position: 0 calc(var(--py, 0) * 1px);
}

.hero-mark {
  display: block;
  width: 44px;
  height: 44px;
  color: var(--ink);
  animation: markIn .7s ease-out both;
}

.hero-mark svg { display: block; }

@keyframes markIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.6rem, 9vw, 7rem);
  font-weight: 700;
  line-height: .96;
  letter-spacing: -.05em;
  max-width: 15em;
  word-break: break-word;
  text-wrap: balance;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) var(--pad);
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: start;
}

.side { order: 2; }

.side-h {
  margin: 0 0 .9rem;
  padding-bottom: .45rem;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .2em;
  border-bottom: 3px solid var(--ink);
}

.side-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid #ddd;
}

.side-list li { border-bottom: 1px solid #ddd; }

.side-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: .35rem .2rem;
  font-size: 15px;
  text-decoration: none;
  transition: padding-left .15s linear, background .15s linear;
}

.side-list a:hover {
  padding-left: .8rem;
  background: #f2f2f2;
  box-shadow: inset 3px 0 0 var(--ink);
}

.side-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 1.2rem;
  padding: .6rem 1rem;
  font-size: 15px;
  text-decoration: none;
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform .14s linear, box-shadow .14s linear;
}

.side-top:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

.main-col { min-width: 0; }

.doc { counter-reset: sec; }

.doc > article {
  counter-increment: sec;
  padding: clamp(1.8rem, 5vw, 3rem) 0;
  border-top: 3px solid var(--ink);
  scroll-margin-top: 5.2rem;
}

.doc > article:first-child {
  border-top: 0;
  padding-top: 0;
}

.doc h2 {
  margin: 0 0 1.1rem;
  font-size: clamp(1.55rem, 4.4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.035em;
  text-wrap: balance;
}

.doc h2::before {
  display: block;
  content: counter(sec, decimal-leading-zero);
  margin-bottom: .55rem;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .22em;
  opacity: .55;
}

.doc h3 {
  margin: 2rem 0 .7rem;
  font-size: clamp(1.15rem, 2.6vw, 1.4rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.3;
  padding-left: .7rem;
  border-left: 5px solid var(--ink);
}

.doc p {
  margin: 0 0 1.05rem;
  max-width: 64ch;
}

.doc ul,
.doc ol {
  margin: 0 0 1.2rem;
  padding-left: 1.3rem;
  max-width: 64ch;
}

.doc li { margin-bottom: .4rem; }

.doc a {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.doc a:hover {
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

.doc strong { font-weight: 700; }

.doc blockquote {
  margin: 1.4rem 0;
  padding: .9rem 1.2rem;
  border-left: 6px solid var(--ink);
  background: #f4f4f4;
}

.doc blockquote p:last-child { margin-bottom: 0; }

.doc img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  margin: 1.4rem 0;
}

.doc figure { margin: 1.4rem 0; }

.doc figcaption {
  font-size: 15px;
  opacity: .7;
  margin-top: .5rem;
}

.doc code {
  font-family: var(--mono);
  font-size: .92em;
  background: #f0f0f0;
  padding: .1em .35em;
}

.doc pre {
  overflow-x: auto;
  padding: 1rem;
  border: 2px solid var(--ink);
  background: #f7f7f7;
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
}

.doc pre code { background: none; padding: 0; }

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0;
  font-size: 16px;
}

.doc th,
.doc td {
  border: 2px solid var(--ink);
  padding: .55rem .7rem;
  text-align: left;
}

.doc th { background: var(--ink); color: var(--paper); font-weight: 600; }

.doc hr {
  border: 0;
  border-top: 3px solid var(--ink);
  margin: 2rem 0;
}

.foot {
  margin-top: clamp(2rem, 6vw, 4rem);
  padding: clamp(2rem, 6vw, 3.5rem) var(--pad) 1.6rem;
  background: var(--ink);
  color: var(--paper);
  border-top: 4px solid var(--ink);
}

.foot-top {
  padding-bottom: 1.1rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--paper);
}

.foot-h {
  margin: 0;
  font-size: clamp(1.9rem, 8vw, 4.2rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.05em;
}

.foot-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.foot dl { margin: 0; }

.foot dt {
  font-size: 15px;
  letter-spacing: .18em;
  opacity: .6;
  margin-bottom: .55rem;
}

.foot dd {
  margin: 0 0 .25rem;
  font-size: 16px;
  word-break: break-word;
}

.foot a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: .35rem 0;
  color: var(--paper);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.foot a:hover { border-bottom-color: var(--paper); }

.copy {
  margin-top: 2.2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, .3);
  font-size: 15px;
  letter-spacing: .1em;
  opacity: .8;
}

@media (min-width: 900px) {
  .wrap { grid-template-columns: 190px minmax(0, 1fr); }
  .side { order: 0; position: sticky; top: 5.6rem; align-self: start; }
  .hero-mark {
    position: absolute;
    right: clamp(1.2rem, 8vw, 6rem);
    top: 50%;
    transform: translateY(-50%);
    animation: none;
  }
}

@media (min-width: 760px) {
  .foot-cols { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
}

@media (max-width: 780px) {
  .bar {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: .1rem;
    padding-bottom: 1.1rem;
  }
  .bar .brand { order: 1; }
  .m { order: 2; justify-content: center; }
  .m-end { order: 3; }
  .m-end summary { order: 0; }
  .m summary { border-bottom-width: 2px; }
  .m-list { justify-content: center; gap: 0 .7rem; }
}

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

button[aria-expanded]{min-width:44px;min-height:44px}
