@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&family=JetBrains+Mono:wght@400&family=Playfair+Display:ital@1&display=swap');

:root {
  --ink: #000000;
  --paper: #ffffff;
  --mute: #5c5c5c;
  --hair: #d9d9d9;
  --gut: clamp(16px, 4vw, 64px);
  --stick: 122px;
  --sans: Inter, "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: "Playfair Display", Georgia, "Songti SC", "SimSun", serif;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.7 var(--sans);
  overflow-x: clip;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--ink); }
h1, h2, h3, h4 { margin: 0; }
p { margin: 0; }

/* ---------- header ---------- */

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

.hd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px var(--gut);
}

.mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 2px solid var(--ink);
  text-decoration: none;
  font-weight: 800;
  font-size: 18px;
  line-height: 1;
  flex: 0 0 auto;
}

.mark img { width: 26px; height: 26px; object-fit: contain; }

.cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--ink);
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .02em;
  transition: background .18s linear, color .18s linear;
}

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

.nav {
  border-top: 1px solid var(--hair);
  padding: 0 var(--gut);
  overflow-x: auto;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar { display: none; }

.nav p {
  display: flex;
  gap: 2px;
  white-space: nowrap;
  margin: 0;
}

.nav a {
  display: inline-block;
  padding: 12px 10px;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: border-color .18s linear, transform .18s ease;
}

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

/* ---------- hero ---------- */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 70vh;
  padding: 92px var(--gut) clamp(28px, 5vh, 60px);
  border-bottom: 3px solid var(--ink);
}

.badge {
  position: absolute;
  top: 22px;
  right: var(--gut);
  margin: 0;
  padding: 6px 12px;
  border: 1px solid var(--ink);
  font-size: 16px;
  letter-spacing: .1em;
  line-height: 1.5;
  background: var(--paper);
}

h1 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.2rem, 8.6vw, 6.6rem);
  line-height: 1.04;
  letter-spacing: -.025em;
  overflow-wrap: break-word;
  max-width: 20ch;
}

.lede {
  margin-top: 1.4rem;
  max-width: 44ch;
  padding-left: 16px;
  border-left: 3px solid var(--ink);
  font-size: 17px;
  line-height: 1.65;
}

/* ---------- layout grid ---------- */

.wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  padding: clamp(28px, 4vw, 56px) var(--gut) clamp(40px, 6vw, 88px);
}

.rail { order: -1; }

@media (min-width: 900px) {
  .wrap {
    grid-template-columns: minmax(0, 1fr) clamp(238px, 23vw, 320px);
    gap: clamp(32px, 5vw, 76px);
    align-items: start;
  }
  .rail {
    order: 0;
    grid-column: 2;
    position: sticky;
    top: calc(var(--stick) + 14px);
    align-self: start;
  }
}

/* ---------- article ---------- */

.prose {
  counter-reset: sec;
  max-width: 64ch;
  font-size: 17px;
  line-height: 1.75;
}

.prose section { scroll-margin-top: clamp(112px, 17vh, 158px); }

.prose > section + section {
  margin-top: 3.4rem;
  padding-top: 2.8rem;
  border-top: 2px solid var(--ink);
}

.prose > section { counter-increment: sec; }

.prose h2 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.55rem, 3.5vw, 2.35rem);
  line-height: 1.16;
  letter-spacing: -.015em;
  margin: 0 0 1rem;
}

.prose h2::before {
  content: counter(sec, decimal-leading-zero);
  display: block;
  margin-bottom: .55rem;
  font-family: var(--sans);
  font-style: normal;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .18em;
}

.prose h3 {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 1.9rem 0 .7rem;
}

.prose h4 {
  font-size: 17px;
  font-weight: 700;
  margin: 1.5rem 0 .5rem;
}

.prose p { margin: 0 0 1.1em; }

.prose ul,
.prose ol {
  margin: 0 0 1.2em;
  padding-left: 1.3em;
}

.prose li { margin-bottom: .5em; }

.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.prose a:hover { text-decoration-thickness: 2px; }

.prose blockquote {
  margin: 1.4em 0;
  padding: .2em 0 .2em 18px;
  border-left: 3px solid var(--ink);
  font-size: 17px;
}

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

.prose strong { font-weight: 700; }

.prose figure { margin: 1.6em 0; }
.prose figcaption { font-size: 16px; color: var(--mute); margin-top: .5em; }

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  margin: 1.4em 0;
}

.prose th,
.prose td {
  border: 1px solid var(--ink);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

/* ---------- aside / rail ---------- */

.rail {
  border: 2px solid var(--ink);
  padding: 18px 16px;
}

.kick {
  display: block;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .22em;
  line-height: 1.5;
}

.rail-t {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  line-height: 1.1;
  letter-spacing: -.01em;
  margin: .15rem 0 .9rem;
  padding-bottom: .7rem;
  border-bottom: 2px solid var(--ink);
}

.rail ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: ix;
}

.rail li {
  counter-increment: ix;
  border-top: 1px solid var(--hair);
}

.rail li:first-child { border-top: 0; }

.rail a {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 11px 0;
  font-size: 16px;
  line-height: 1.5;
  text-decoration: none;
}

.rail a::before {
  content: counter(ix, decimal-leading-zero);
  font-weight: 700;
  font-size: 16px;
  color: var(--mute);
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}

.rail a:hover,
.rail a.on { text-decoration: underline; text-underline-offset: 4px; }
.rail a:hover::before,
.rail a.on::before { color: var(--ink); }

/* ---------- footer ---------- */

.ft {
  border-top: 3px solid var(--ink);
  margin-top: clamp(36px, 6vw, 88px);
  padding: clamp(28px, 4vw, 52px) var(--gut) 0;
}

.ft-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
}

@media (min-width: 860px) {
  .ft-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
}

.ft dl { margin: 0; }

.ft dt {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .2em;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 6px;
}

.ft dd {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
}

.ft dd a {
  display: inline-block;
  padding: 12px 0;
  text-decoration: none;
}

.ft dd a:hover { text-decoration: underline; text-underline-offset: 4px; }

.ft-cta { display: flex; align-items: flex-start; }

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 2px solid var(--ink);
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  transition: background .18s linear, color .18s linear;
}

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

.ft-base {
  margin-top: clamp(24px, 4vw, 44px);
  padding: 16px 0 20px;
  border-top: 1px solid var(--hair);
  text-align: center;
  font-size: 16px;
  line-height: 1.6;
}

/* ---------- motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .rv .rv-el { opacity: 0; transform: translateY(18px); }
  .rv .rv-el.in {
    opacity: 1;
    transform: none;
    transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .3, 1);
  }
}

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

/* ---------- narrow tweaks ---------- */

@media (max-width: 420px) {
  .hd-row { padding: 8px var(--gut); }
  .cta { padding: 0 12px; font-size: 16px; }
  .hero { min-height: auto; padding-top: 84px; }
  .badge { top: 16px; }
}

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