:root{
  --paper:#fafaf8;
  --ink:#1a1a1a;
  --mid:#4a4a4a;
  --soft:rgba(26,26,26,.12);
  --edge:rgba(26,26,26,.78);
  --font:"Fredoka","Nunito","PingFang SC","Hiragino Sans GB","Microsoft YaHei","Source Han Sans SC",system-ui,sans-serif;
  --sidebar:232px;
}

*{box-sizing:border-box}

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

body{
  margin:0;
  color:var(--ink);
  font-family:var(--font);
  font-size:17px;
  line-height:1.78;
  background-color:var(--paper);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.24'/%3E%3C/svg%3E"),
    radial-gradient(circle at 12% 16%,rgba(74,74,74,.07),transparent 44%),
    radial-gradient(circle at 84% 74%,rgba(26,26,26,.06),transparent 42%);
}

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

a{color:var(--ink);text-decoration:none}

.sr{
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;
  overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0
}

hr{
  border:0;
  height:3px;
  margin:10px 0 16px;
  background:repeating-linear-gradient(90deg,var(--ink) 0 11px,transparent 11px 16px);
  opacity:.62;
  transform:rotate(-.5deg);
}

button,input{font-family:inherit;font-size:inherit;color:var(--ink)}

input[type=search],input[type=email]{
  width:100%;min-width:0;min-height:42px;padding:9px 11px;
  background:#fffdf6;
  border:2px solid rgba(26,26,26,.66);
  border-radius:14px 17px 13px 16px / 16px 13px 17px 14px;
}
input::placeholder{color:#8a8a86}

button{
  min-height:42px;padding:9px 14px;font-weight:600;cursor:pointer;
  background:#fffdf6;
  border:2px solid var(--ink);
  border-radius:12px 16px 11px 15px / 15px 11px 16px 12px;
  box-shadow:3px 3px 0 var(--soft);
  transition:transform .1s steps(2,end),box-shadow .1s linear;
}
button:hover{transform:translate(-1px,-2px) rotate(-1.3deg)}
button:active{transform:translate(1px,1px);box-shadow:1px 1px 0 var(--soft)}

.topbar{
  position:fixed;
  inset:0 auto 0 0;
  z-index:30;
  width:var(--sidebar);
  display:flex;
  flex-direction:column;
  gap:16px;
  padding:22px 16px 26px;
  overflow-y:auto;
  background:rgba(250,250,248,.93);
  border-right:2px dashed rgba(26,26,26,.34);
  backdrop-filter:blur(4px);
}

.brand{
  display:inline-flex;align-items:center;gap:9px;
  padding:8px 8px 8px 4px;min-height:44px;
  font-weight:700;font-size:20px;letter-spacing:.02em;
  transform:rotate(-1.1deg);
}
.brand .mark{
  display:inline-flex;align-items:center;justify-content:center;
  width:30px;height:30px;flex:none;
  background:#fffdf6;
  border:2px solid var(--ink);
  border-radius:52% 48% 46% 54% / 48% 52% 48% 52%;
  font-size:15px;
}
.brandname{border-bottom:3px solid var(--ink);padding-bottom:1px}

.nav p{
  display:flex;flex-direction:column;gap:4px;margin:0;
}

.nav a{
  display:flex;align-items:center;gap:9px;
  min-height:44px;padding:10px 11px;
  border:2px solid transparent;
  border-radius:14px 18px 12px 17px / 17px 12px 18px 14px;
  font-size:16px;
  transition:transform .1s steps(2,end),background .1s linear;
}
.nav a:hover,.nav a.on{
  background:#fffdf6;
  border-color:var(--ink);
  transform:rotate(-.9deg);
}
.bullet{
  width:10px;height:10px;flex:none;
  border:2px solid var(--mid);
  border-radius:50% 42% 58% 46%;
}
.nav a:hover .bullet,.nav a.on .bullet{background:var(--ink);border-color:var(--ink)}

.findbox{display:flex;flex-direction:column;gap:7px;margin-top:auto}

main{margin-left:var(--sidebar)}

.wrap{
  display:grid;
  grid-template-columns:196px minmax(0,1fr);
  grid-template-areas:
    "hero hero"
    "aside body";
  gap:26px 30px;
  max-width:1180px;
  margin:0 auto;
  padding:22px 26px 64px;
}

.hero{grid-area:hero}
.body{grid-area:body}
.note{grid-area:aside}

.hero-card{
  position:relative;
  display:flex;
  align-items:flex-end;
  min-height:70vh;
  overflow:hidden;
  background:#efeee9;
  border:2px solid var(--ink);
  border-radius:28px;
  box-shadow:7px 8px 0 var(--soft);
}

.hero-media{position:absolute;inset:0}
.hero-media img{
  width:100%;height:100%;object-fit:cover;
  filter:grayscale(.18) contrast(1.07);
}
.veil{
  position:absolute;inset:0;
  background:linear-gradient(96deg,rgba(250,250,248,.94) 0%,rgba(250,250,248,.7) 46%,rgba(250,250,248,.14) 100%);
}

.hero-copy{
  position:relative;
  padding:clamp(20px,4vw,46px);
  max-width:640px;
  text-align:left;
}

.hero-copy h1{
  margin:0 0 12px;
  font-size:clamp(30px,5.6vw,54px);
  line-height:1.14;
  letter-spacing:.005em;
  word-break:break-word;
  text-shadow:2px 2px 0 rgba(250,250,248,.85);
}

.lead{
  margin:0;
  font-size:clamp(16px,2vw,18px);
  color:var(--mid);
  line-height:1.7;
  max-width:52ch;
}

.note{
  position:sticky;
  top:26px;
  align-self:start;
  padding:14px 15px 18px;
  background:#fffdf6;
  border:2px solid var(--ink);
  border-radius:18px 23px 16px 24px / 22px 16px 24px 18px;
  box-shadow:4px 5px 0 var(--soft);
  transform:rotate(-1.5deg);
}
.note::before{
  content:"";
  position:absolute;
  top:-13px;left:50%;
  width:76px;height:24px;
  transform:translateX(-50%) rotate(-3deg);
  background:rgba(74,74,74,.17);
  border:1px dashed rgba(26,26,26,.34);
}

.note h2{
  margin:0;
  font-size:18px;
  letter-spacing:.14em;
  transform:rotate(-.6deg);
}

.toc{
  list-style:none;margin:0;padding:0;
  counter-reset:toc;
}
.toc li{
  counter-increment:toc;
  opacity:0;
  animation:rise .4s steps(6,end) forwards;
}
.toc li::before{
  content:counter(toc,decimal-leading-zero);
  font-size:12px;
  color:var(--mid);
  letter-spacing:.08em;
  margin-right:6px;
}
.toc a{
  display:inline-flex;align-items:center;min-height:40px;
  font-size:15px;
  color:var(--mid);
  border-bottom:2px solid transparent;
}
.toc a:hover,.toc a.on{color:var(--ink);border-color:var(--ink)}

.toc li:nth-child(1){animation-delay:.02s}
.toc li:nth-child(2){animation-delay:.06s}
.toc li:nth-child(3){animation-delay:.1s}
.toc li:nth-child(4){animation-delay:.14s}
.toc li:nth-child(5){animation-delay:.18s}
.toc li:nth-child(6){animation-delay:.22s}
.toc li:nth-child(7){animation-delay:.26s}

@keyframes rise{
  from{opacity:0;transform:translateY(7px) rotate(-1deg)}
  to{opacity:1;transform:none}
}

section{scroll-margin-top:112px}

.prose{
  max-width:74ch;
  font-size:17px;
  line-height:1.8;
}

.prose > section{
  margin:0 0 34px;
  padding:clamp(18px,2.6vw,32px);
  background:rgba(255,255,255,.56);
  border:2px solid var(--edge);
  border-radius:28px;
  box-shadow:6px 7px 0 rgba(26,26,26,.09);
  backdrop-filter:blur(7px) saturate(1.04);
  transform:rotate(-.22deg);
  transition:transform .12s steps(3,end),box-shadow .12s linear;
}
.prose > section:nth-child(even){transform:rotate(.26deg)}
.prose > section:hover{
  transform:rotate(0deg) translate(-2px,-3px);
  box-shadow:10px 12px 0 rgba(26,26,26,.12);
}

.prose h2{
  display:inline-block;
  margin:.1em 0 .05em;
  font-size:clamp(21px,2.9vw,28px);
  line-height:1.3;
  letter-spacing:.01em;
  transform:rotate(-.5deg);
  background:linear-gradient(transparent 79%,rgba(74,74,74,.2) 79%);
  padding-bottom:2px;
  word-break:break-word;
}
.prose h2 + hr{margin-top:8px}

.prose h3{
  margin:1.2em 0 .4em;
  font-size:clamp(18px,2.2vw,21px);
  line-height:1.4;
  transform:rotate(-.35deg);
}

.prose p{margin:0 0 .95em}
.prose p:last-child{margin-bottom:0}

.prose a{
  color:var(--ink);
  border-bottom:2px solid rgba(26,26,26,.45);
}
.prose a:hover{background:rgba(74,74,74,.14)}

.prose ul,.prose ol{margin:.2em 0 1em;padding-left:1.35em}
.prose li{margin:.3em 0}

.prose img{
  margin:1.1em 0;
  border:2px solid var(--ink);
  border-radius:16px;
  transform:rotate(.4deg);
}

.prose blockquote{
  margin:1.1em 0;
  padding:12px 16px;
  border-left:5px solid var(--mid);
  background:rgba(255,253,246,.8);
  border-radius:0 16px 16px 0;
  color:var(--mid);
}
.prose blockquote p:last-child{margin:0}

.foot{
  margin-left:var(--sidebar);
  padding:34px 26px 20px;
  background:rgba(255,253,246,.72);
  border-top:2px dashed rgba(26,26,26,.34);
}

.foot-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:22px;
  max-width:1180px;
  margin:0 auto;
}

.foot dt{
  font-weight:700;
  letter-spacing:.1em;
  font-size:15px;
  margin-bottom:6px;
}
.foot dt::after{
  content:"";
  display:block;
  width:34px;height:3px;
  margin-top:7px;
  background:var(--mid);
  border-radius:2px;
  transform:rotate(-1.6deg);
}
.foot dd{margin:0 0 4px;font-size:15px;color:var(--mid);word-break:break-all}
.foot dd a{
  display:inline-flex;align-items:center;min-height:40px;
  border-bottom:2px solid transparent;
}
.foot dd a:hover{color:var(--ink);border-color:var(--ink)}

.sub{display:flex;flex-direction:column;gap:7px}
.sub input{min-height:42px}

.foot-bar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  flex-wrap:wrap;
  max-width:1180px;
  margin:22px auto 0;
  padding-top:14px;
  border-top:2px solid rgba(26,26,26,.2);
  font-size:15px;
  color:var(--mid);
}
.foot-bar p{margin:0}
.foot-bar a{display:inline-flex;align-items:center;min-height:40px;border-bottom:2px solid transparent}
.foot-bar a:hover{color:var(--ink);border-color:var(--ink)}

@media (max-width:900px){
  .wrap{
    grid-template-columns:minmax(0,1fr);
    grid-template-areas:
      "hero"
      "aside"
      "body";
    gap:22px;
    padding:16px 16px 48px;
  }
  .prose{max-width:none}
  .foot-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media (max-width:860px){
  .topbar{
    position:sticky;
    inset:0 0 auto 0;
    width:auto;
    display:grid;
    grid-template-columns:1fr auto;
    grid-template-areas:
      "brand find"
      "nav nav";
    align-items:center;
    gap:8px 10px;
    padding:10px 14px 12px;
    border-right:0;
    border-bottom:2px dashed rgba(26,26,26,.34);
    overflow:visible;
  }
  .brandbar{grid-area:brand}
  .brand{font-size:18px}
  .findbox{
    grid-area:find;
    flex-direction:row;
    margin:0;
    width:min(52vw,220px);
  }
  .findbox input{min-height:40px;padding:6px 9px}
  .findbox button{min-height:40px;padding:6px 12px}
  .nav{grid-area:nav;min-width:0}
  .nav p{
    flex-direction:row;
    gap:4px;
    overflow-x:auto;
    padding-bottom:2px;
    -webkit-overflow-scrolling:touch;
  }
  .nav a{
    flex:none;
    white-space:nowrap;
    min-height:42px;
    padding:9px 12px;
    font-size:15px;
  }
  main{margin-left:0}
  .wrap{padding-top:14px}
  .hero-card{min-height:56vh;align-items:flex-start;border-radius:22px}
  .hero-copy{padding:22px 18px 26px;max-width:none}
  .lead{font-size:16px}
  .note{
    position:static;
    transform:rotate(-1deg);
    padding:10px 12px 12px;
  }
  .note h2{font-size:16px}
  hr{margin:8px 0 10px}
  .toc{
    display:flex;
    gap:12px;
    overflow-x:auto;
    padding-bottom:2px;
  }
  .toc li{flex:none}
  .toc a{font-size:15px}
  .prose{font-size:16px;line-height:1.75}
  .foot{margin-left:0;padding:26px 16px 18px}
  div{scroll-margin-top:132px}
}

@media (max-width:420px){
  .foot-grid{grid-template-columns:minmax(0,1fr)}
  .hero-card{min-height:52vh}
  .findbox{width:auto}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *{animation:none!important;transition:none!important}
  .toc li{opacity:1}
}

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