@import url('https://fonts.googleapis.com/css2?family=Kalam:wght@400;700&family=Patrick+Hand&display=swap');

:root{
  --ink:#000000;
  --paper:#ffffff;
  --fog:#767676;
  --wash:#f2f2f2;
  --rule:#d9d9d9;
  --hand:'Patrick Hand','Kalam','Xingkai SC','KaiTi','STKaiti',cursive;
  --sans:Helvetica,'Helvetica Neue',Arial,'PingFang SC','Hiragino Sans GB','Microsoft YaHei',sans-serif;
}

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

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

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

img{max-width:100%;height:auto;display:block}

a{color:var(--ink)}

h1,h2,h3,h4{margin:0 0 .6rem;line-height:1.2;letter-spacing:-.01em}
h1{font-weight:700}
h2{font-size:clamp(1.35rem,2.6vw,1.75rem);font-weight:700}
h3{font-size:1.15rem;font-weight:700}
p{margin:0 0 .9rem}
ol,ul{margin:0 0 1rem;padding-left:1.2rem}
:focus-visible{outline:3px solid var(--ink);outline-offset:2px}

/* ---------- top bar ---------- */
.bar{
  display:flex;
  align-items:center;
  gap:.75rem;
  padding:.55rem clamp(.7rem,3vw,1.4rem);
  border-bottom:2px solid var(--ink);
  background:var(--paper);
}
.mark{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:44px;height:44px;
  border:2px solid var(--ink);
  border-radius:4px;
  text-decoration:none;
  font-family:var(--hand);
  font-size:1.4rem;
  line-height:1;
}
.mark img{width:40px;height:40px;object-fit:cover;border-radius:2px}
.mark:hover{background:var(--ink);color:var(--paper)}

.find{
  margin-left:auto;
  display:flex;
  gap:.4rem;
  min-width:0;
}
.find-i{
  width:min(30vw,220px);
  min-height:44px;
  padding:.4rem .7rem;
  font:inherit;
  font-size:16px;
  color:var(--ink);
  background:var(--paper);
  border:2px solid var(--ink);
  border-radius:4px;
}
.find-b{
  min-height:44px;
  padding:.4rem 1rem;
  font:inherit;
  font-size:16px;
  font-weight:700;
  color:var(--paper);
  background:var(--ink);
  border:2px solid var(--ink);
  border-radius:4px;
  cursor:pointer;
}
.find-b:hover,.find-b:focus-visible{background:var(--paper);color:var(--ink)}

/* ---------- sticky anchor bar ---------- */
.anchors{
  position:sticky;
  top:0;
  z-index:30;
  display:flex;
  background:var(--ink);
  border-bottom:2px solid var(--ink);
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
}
.anchors a{
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:.55rem 1rem;
  color:var(--paper);
  text-decoration:none;
  font-size:16px;
  white-space:nowrap;
  border-right:1px solid #3a3a3a;
  transition:background .15s linear,color .15s linear;
}
.anchors a:hover,.anchors a:focus-visible{background:var(--paper);color:var(--ink)}

/* ---------- hero ---------- */
.hero{
  position:relative;
  display:grid;
  grid-template-columns:repeat(12,1fr);
  gap:1rem;
  min-height:70vh;
  padding:clamp(1.5rem,5vw,3.5rem) clamp(1rem,4vw,2.5rem) 5rem;
  background:var(--ink);
  color:var(--paper);
  overflow:hidden;
  clip-path:polygon(0 0,100% 0,100% calc(100% - 2.5rem),0 100%);
}
.hero::before{
  content:"";
  position:absolute;
  inset:0;
  background-image:
    linear-gradient(to right,rgba(255,255,255,.13) 1px,transparent 1px),
    linear-gradient(to bottom,rgba(255,255,255,.13) 1px,transparent 1px);
  background-size:calc(100% / 12) 4rem;
  pointer-events:none;
}
.hero::after{
  content:"";
  position:absolute;
  left:-1rem;right:-1rem;
  bottom:3.2rem;
  height:6px;
  background:var(--paper);
  transform:rotate(-.8deg);
  z-index:1;
}
.hero-img{
  position:absolute;
  inset:0;
  width:100%;height:100%;
  object-fit:cover;
  filter:grayscale(1);
  opacity:.5;
  z-index:0;
}
.hero-grid{
  grid-column:6 / span 7;
  align-self:start;
  position:relative;
  z-index:2;
  text-align:right;
}
.kicker{
  display:inline-block;
  margin:0 0 .8rem;
  padding-bottom:.25rem;
  border-bottom:2px solid var(--paper);
  font-family:var(--hand);
  font-size:1.1rem;
  letter-spacing:.08em;
}
.hero h1{
  margin:0 0 .9rem;
  font-size:clamp(1.9rem,5.6vw,3.5rem);
  line-height:1.14;
}
.lead{
  max-width:34ch;
  margin:0 0 0 auto;
  color:#e8e8e8;
  font-size:1rem;
}

/* ---------- main grid ---------- */
main{padding:clamp(1.5rem,4vw,3rem) 0 clamp(1rem,3vw,2rem)}

.wrap{
  display:grid;
  grid-template-columns:repeat(12,1fr);
  gap:1rem;
  max-width:1180px;
  margin:0 auto;
  padding:0 clamp(1rem,4vw,2rem);
}

.rail{
  grid-column:1 / span 3;
  align-self:start;
  position:sticky;
  top:64px;
  border-top:3px solid var(--ink);
  padding-top:.9rem;
}
.rail h2{
  font-family:var(--hand);
  font-size:1.5rem;
  margin:0 0 .35rem;
}
.subtitle{
  margin:0 0 1rem;
  font-size:1rem;
  line-height:1.55;
  color:#3d3d3d;
}
.toc{
  list-style:none;
  margin:0;
  padding:0;
  counter-reset:toc;
}
.toc li{
  counter-increment:toc;
  border-bottom:1px solid var(--rule);
}
.toc li:first-child{border-top:1px solid var(--rule)}
.toc a{
  display:flex;
  gap:.5rem;
  align-items:baseline;
  min-height:44px;
  padding:.6rem 0;
  font-size:16px;
  text-decoration:none;
}
.toc a::before{
  content:counter(toc,decimal-leading-zero);
  font-family:var(--hand);
  font-size:1rem;
  color:var(--fog);
}
.toc a:hover span{text-decoration:underline;text-underline-offset:3px}

.stage{grid-column:4 / span 9;min-width:0}

/* ---------- div body ---------- */
.body{
  max-width:70ch;
  counter-reset:sec;
}
.body [id]{scroll-margin-top:76px}
.body > article{
  border-top:1px solid var(--ink);
  padding-top:1rem;
  margin:0 0 2.25rem;
  counter-increment:sec;
  animation:rise .5s ease both;
}
.body > article::before{
  content:counter(sec,decimal-leading-zero);
  display:block;
  margin-bottom:.35rem;
  font-family:var(--hand);
  font-size:1.25rem;
  color:var(--fog);
}
.body > article h2::after{
  content:"";
  display:block;
  width:3rem;height:3px;
  margin-top:.6rem;
  background:var(--ink);
}
.body p,.body li{overflow-wrap:break-word}
.body ul li,.body ol li{margin-bottom:.4rem}
.body img{
  margin:.5rem 0 1rem;
  border:2px solid var(--ink);
  border-radius:4px;
}
.body figure{margin:0 0 1rem}
.body table{
  width:100%;
  margin:0 0 1.2rem;
  border-collapse:collapse;
  font-size:16px;
}
.body th,.body td{
  padding:.5rem .6rem;
  border:1px solid var(--ink);
  text-align:left;
  vertical-align:top;
}
.body th{background:var(--wash)}
.body blockquote{
  margin:0 0 1.2rem;
  padding:.55rem 0 .55rem 1rem;
  border-left:4px solid var(--ink);
  font-family:var(--hand);
  font-size:1.05rem;
}
.hit{background:var(--wash)}

/* ---------- footer ---------- */
footer{
  margin-top:clamp(2rem,6vw,4rem);
  border-top:3px solid var(--ink);
  background:var(--paper);
}
.foot-grid{
  display:grid;
  grid-template-columns:repeat(12,1fr);
  gap:1rem;
  max-width:1180px;
  margin:0 auto;
  padding:clamp(1.25rem,4vw,2.5rem) clamp(1rem,4vw,2rem);
}
.cta{
  grid-column:1 / span 5;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  padding:1.25rem;
  border:2px solid var(--ink);
  border-radius:4px;
  background:var(--ink);
  color:var(--paper);
}
.cta h2{
  font-family:var(--hand);
  font-size:clamp(1.6rem,3vw,2.1rem);
  margin:0 0 .4rem;
}
.cta .subtitle{color:#dddddd}
.to-top{
  margin-top:auto;
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:.4rem 1rem;
  border:2px solid var(--paper);
  border-radius:4px;
  color:var(--paper);
  font-weight:700;
  text-decoration:none;
  transition:background .15s linear,color .15s linear;
}
.to-top:hover,.to-top:focus-visible{background:var(--paper);color:var(--ink)}

.cols{
  grid-column:6 / span 7;
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:1rem;
}
.cols dl{
  margin:0;
  padding-top:.5rem;
  border-top:2px solid var(--ink);
}
.cols dt{
  margin-bottom:.25rem;
  font-family:var(--hand);
  font-size:1.15rem;
}
.cols dd{
  margin:0;
  border-bottom:1px solid var(--rule);
}
.cols dd a{
  display:flex;
  align-items:center;
  min-height:44px;
  padding:.3rem 0;
  font-size:16px;
  text-decoration:none;
}
.cols dd a:hover,.cols dd a:focus-visible{text-decoration:underline;text-underline-offset:3px}

.base{
  padding:1rem;
  border-top:1px solid var(--ink);
  text-align:center;
}
.base p{
  margin:0;
  font-size:16px;
  color:#3f3f3f;
}

/* ---------- motion ---------- */
@keyframes rise{
  from{opacity:0;transform:translateY(14px)}
  to{opacity:1;transform:none}
}
.hero-grid > *{animation:rise .6s ease both}
.hero-grid > *:nth-child(1){animation-delay:.05s}
.hero-grid > *:nth-child(2){animation-delay:.12s}
.hero-grid > *:nth-child(3){animation-delay:.2s}
.body > article:nth-child(1){animation-delay:.04s}
.body > article:nth-child(2){animation-delay:.08s}
.body > article:nth-child(3){animation-delay:.12s}
.body > article:nth-child(4){animation-delay:.16s}
.body > article:nth-child(5){animation-delay:.2s}
.body > article:nth-child(6){animation-delay:.24s}
.body > article:nth-child(7){animation-delay:.28s}
.body > article:nth-child(n+8){animation-delay:.32s}

/* ---------- responsive ---------- */
@media (max-width:900px){
  .wrap{grid-template-columns:1fr;gap:.5rem}
  .rail,.stage{grid-column:1 / -1}
  .rail{position:static;top:auto}
  .hero{grid-template-columns:1fr;min-height:62vh;padding-bottom:4.5rem}
  .hero::after{bottom:2.6rem}
  .hero-grid{grid-column:1 / -1;max-width:none}
  .find-i{width:auto;flex:1 1 auto;min-width:0}
  .foot-grid{grid-template-columns:1fr}
  .cta,.cols{grid-column:1 / -1}
  .cols{grid-template-columns:1fr 1fr}
  .body{max-width:none}
}

@media (max-width:430px){
  .hero h1{font-size:1.8rem}
  .lead{max-width:none}
  .cols{grid-template-columns:1fr}
  .bar{padding-inline:.55rem}
  .find-b{padding:.4rem .7rem}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{
    animation:none!important;
    transition:none!important;
  }
}

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