:root {
  --paper: #f5f1e8;
  --paper-2: #ece6da;
  --ink: #171713;
  --muted: #68665f;
  --blue: #315ee8;
  --orange: #ff6946;
  --card: #fbf8f1;
}
html[data-theme="dark"] {
  --paper: #141414;
  --paper-2: #1d1d1b;
  --ink: #f3efe7;
  --muted: #aaa69d;
  --blue: #7294ff;
  --orange: #ff896f;
  --card: #1a1a18;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(color-mix(in srgb, var(--ink) 8%, transparent) .7px, transparent .7px),
    var(--paper);
  background-size: 18px 18px;
  font-family: Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; }
::selection { color: #fff; background: var(--blue); }
.progress { position: fixed; z-index: 90; inset: 0 auto auto 0; width: 0; height: 3px; background: var(--orange); }
.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  height: 76px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 32px;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
  background: color-mix(in srgb, var(--paper) 89%, transparent);
  backdrop-filter: blur(14px);
}
.wordmark { display: flex; width: fit-content; align-items: center; gap: 11px; }
.wordmark-mark {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  font-weight: 900;
}
.wordmark-copy { display: flex; flex-direction: column; line-height: 1.05; }
.wordmark-copy strong { font-size: 14px; }
.wordmark-copy small { margin-top: 5px; color: var(--muted); font: 9px/1 ui-monospace, monospace; text-transform: uppercase; letter-spacing: .12em; }
nav { display: flex; gap: 28px; font: 700 12px/1 ui-monospace, monospace; text-transform: uppercase; letter-spacing: .05em; }
nav a { position: relative; }
nav a::after { content: ""; position: absolute; right: 100%; bottom: -5px; left: 0; height: 2px; background: var(--blue); transition: right .2s ease; }
nav a:hover::after { right: 0; }
.theme-toggle { justify-self: end; width: 36px; height: 36px; border: 1px solid var(--ink); border-radius: 50%; background: transparent; cursor: pointer; }
.shell { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.hero { padding: 54px 0 82px; border-bottom: 1px solid var(--ink); }
.hero-cover {
  width: min(980px, 92%);
  margin: 0 auto 58px;
  border: 1px solid var(--ink);
  background: #fff;
  box-shadow: 8px 8px 0 var(--ink);
}
.hero-cover img { display: block; width: 100%; height: auto; }
h1 { max-width: 1000px; margin: 0 0 30px; font-weight: 780; line-height: 1.03; letter-spacing: -.065em; text-wrap: balance; }
h1 span { display: block; }
h1 .title-first { font-size: clamp(58px, 8vw, 104px); }
h1 .title-second { margin-top: .16em; color: var(--blue); font-size: clamp(35px, 4.8vw, 62px); letter-spacing: -.045em; }
.byline { font: 700 16px/1.4 ui-monospace, monospace; letter-spacing: .025em; }
.lead { max-width: 780px; margin: 34px 0 0; color: var(--muted); font-size: clamp(18px, 2vw, 22px); line-height: 1.8; }
.cover-note { max-width: 980px; margin: 14px auto 0; color: var(--muted); font: 700 11px/1.5 ui-monospace, monospace; }
.article-layout { display: grid; grid-template-columns: 132px minmax(0, 740px); justify-content: center; gap: 54px; padding: 100px 0 132px; }
.rail { position: sticky; top: 118px; height: fit-content; padding-top: 8px; border-top: 4px solid var(--blue); }
.rail-number { display: block; margin-top: 13px; color: color-mix(in srgb, var(--ink) 20%, transparent); font: 900 74px/.85 Arial, sans-serif; }
.rail p { margin: 18px 0 0; color: var(--muted); font: 800 9px/1.55 ui-monospace, monospace; letter-spacing: .07em; }
article {
  min-width: 0;
  color: color-mix(in srgb, var(--ink) 94%, transparent);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 18px;
  line-height: 2;
  letter-spacing: .01em;
  text-wrap: pretty;
  overflow-wrap: anywhere;
}
article p { margin: 0 0 1.38em; }
article h2 {
  position: relative;
  margin: 4.4em 0 1.3em;
  padding: 0 0 .52em 23px;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 22%, transparent);
  font-size: clamp(27px, 3.2vw, 38px);
  font-weight: 780;
  line-height: 1.35;
  letter-spacing: -.04em;
}
article h2:first-child { margin-top: 0; }
article h2::before { content: ""; position: absolute; top: .34em; left: 0; width: 9px; height: 9px; background: var(--blue); box-shadow: 5px 5px 0 var(--orange); }
article h3 {
  width: fit-content;
  margin: 2.8em 0 .9em;
  padding-bottom: .38em;
  border-bottom: 2px solid var(--orange);
  font-size: 21px;
  font-weight: 820;
  line-height: 1.45;
}
article ol, article ul { margin: .2em 0 1.8em; padding-left: 1.45em; }
article li { margin: .55em 0; padding-left: .3em; }
.formula {
  margin: 2.1em 0;
  padding: 24px 28px;
  overflow-x: auto;
  border: 1px solid var(--ink);
  background: var(--card);
  box-shadow: 6px 6px 0 var(--ink);
  font: 600 clamp(15px, 2vw, 20px)/1.8 "Cambria Math", "Times New Roman", serif;
  text-align: center;
  white-space: nowrap;
}
.formula .stack { display: block; }
.reference { color: var(--muted); font-size: 15px; }
.note-list { list-style: square; }
.direction { margin-top: 3.1em; }
.article-link { color: var(--blue); border-bottom: 1px solid currentColor; font-weight: 750; }
.article-link:hover { color: var(--orange); }
.end { display: flex; justify-content: space-between; margin-bottom: 110px; padding: 18px 0; border-block: 1px solid var(--ink); font: 800 10px/1 ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; }
.end a { color: var(--blue); }
footer { min-height: 78px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: center; padding: 20px 32px; border-top: 1px solid var(--ink); font: 700 9px/1.4 ui-monospace, monospace; text-transform: uppercase; letter-spacing: .05em; }
footer span:nth-child(2) { color: var(--muted); text-align: center; }
footer a { justify-self: end; }
@media (max-width: 900px) {
  .site-header { grid-template-columns: 1fr auto; padding: 0 20px; }
  nav { display: none; }
  .article-layout { grid-template-columns: minmax(0, 740px); }
  .rail { display: none; }
}
@media (max-width: 640px) {
  .shell { width: min(100% - 30px, 1180px); }
  .hero { padding: 34px 0 58px; }
  .hero-cover { width: calc(100% - 6px); margin-bottom: 45px; box-shadow: 5px 5px 0 var(--ink); }
  h1 .title-first { font-size: clamp(46px, 13vw, 64px); }
  h1 .title-second { font-size: clamp(30px, 8.6vw, 44px); }
  .lead { font-size: 17px; line-height: 1.9; }
  .article-layout { padding: 65px 0 92px; }
  article { font-size: 17px; line-height: 1.95; letter-spacing: 0; }
  article h2 { margin-top: 3.4em; font-size: 27px; }
  .formula { padding: 20px 14px; text-align: left; }
  footer { grid-template-columns: 1fr; text-align: center; }
  footer a { justify-self: center; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition-duration: .01ms !important; } }
