@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@300;400;500;600;700&family=Noto+Sans:wght@300;400;500;600;700&display=swap');

:root{
  --ink:#000000;
  --paper:#ffffff;
  --soft:#f2f2f2;
  --line:rgba(0,0,0,.16);
  --mute:#5b5b5b;
  --unit:8px;
  --gap:16px;
  --edge:clamp(18px,5vw,64px);
  --head-h:104px;
}

*,*::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-family:'Be Vietnam Pro','Noto Sans',Helvetica,Arial,system-ui,'PingFang SC','Microsoft YaHei',sans-serif;
  font-size:18px;
  font-weight:400;
  line-height:1.7;
  letter-spacing:.005em;
  overflow-x:hidden;
}

img{max-width:100%}

a{color:inherit}

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

section[id]{
  scroll-margin-top:calc(var(--head-h) + 12px);
}

/* ---------- head ---------- */

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

.strip{
  margin:0;
  padding:5px var(--edge);
  font-size:14px;
  line-height:1.5;
  letter-spacing:.28em;
  border-bottom:1px solid var(--line);
  color:var(--mute);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px var(--edge);
}

.logo{
  display:flex;
  align-items:center;
  justify-content:center;
  min-width:44px;
  min-height:44px;
  padding:4px;
  text-decoration:none;
  flex:0 0 auto;
}

.logo .mark{
  width:34px;
  height:34px;
  object-fit:contain;
  display:block;
}

.marktxt{
  display:flex;
  align-items:center;
  justify-content:center;
  width:34px;
  height:34px;
  background:var(--ink);
  color:var(--paper);
  font-weight:700;
  font-size:17px;
  line-height:1;
}

.nav{
  flex:1 1 auto;
  min-width:0;
  display:flex;
  justify-content:flex-end;
}

.nav p{
  display:flex;
  align-items:center;
  gap:2px;
  margin:0;
  padding:0;
  overflow-x:auto;
  scrollbar-width:none;
}

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

.nav a{
  display:block;
  flex:0 0 auto;
  padding:12px 10px;
  min-height:44px;
  font-size:15px;
  line-height:1.4;
  text-decoration:none;
  white-space:nowrap;
  border-bottom:2px solid transparent;
  transition:border-color .18s ease,color .18s ease;
}

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

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

.wrap{
  width:100%;
  margin:0;
}

.hero{
  position:relative;
  display:grid;
  grid-template-columns:repeat(12,1fr);
  gap:var(--gap);
  align-items:end;
  min-height:45vh;
  padding:calc(var(--unit)*6) var(--edge) calc(var(--unit)*8);
  background:var(--ink);
  color:var(--paper);
  clip-path:polygon(0 0,100% 0,100% calc(100% - 34px),0 100%);
  overflow:hidden;
}

.herofig{
  position:absolute;
  inset:0;
  margin:0;
  z-index:0;
}

.herofig .heromedia{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  opacity:.48;
  transform:scale(1.02);
  transition:transform 1.1s cubic-bezier(.2,.7,.2,1);
}

@media (hover:hover){
  .hero:hover .herofig .heromedia{transform:scale(1.07)}
}

.herotext{
  position:relative;
  z-index:1;
  grid-column:1 / -1;
}

.herotext h1{
  margin:0 0 14px;
  font-size:clamp(2.2rem,7.4vw,5.4rem);
  line-height:1.02;
  font-weight:700;
  letter-spacing:-.035em;
}

.lead{
  margin:0;
  max-width:46ch;
  font-size:16px;
  font-weight:300;
  line-height:1.65;
  color:rgba(255,255,255,.82);
}

/* ---------- entry ---------- */

.entry{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:32px;
  padding:40px var(--edge) 20px;
}

.side{
  border-top:3px solid var(--ink);
  padding-top:16px;
  align-self:start;
}

.side small{
  display:block;
  font-size:14px;
  line-height:1.5;
  letter-spacing:.24em;
  color:var(--mute);
  margin-bottom:6px;
}

.side h2{
  margin:0 0 14px;
  font-size:17px;
  line-height:1.4;
  font-weight:600;
  letter-spacing:-.01em;
}

.toc a{
  display:block;
  padding:10px 0;
  min-height:42px;
  font-size:15px;
  text-decoration:none;
  border-bottom:1px solid var(--line);
  transition:padding-left .2s ease,background .2s ease;
}

.toc a:hover{
  padding-left:8px;
  background:var(--soft);
}

/* ---------- prose ---------- */

.prose{
  min-width:0;
  max-width:70ch;
  font-size:18px;
  line-height:1.75;
}

.prose h2{
  margin:56px 0 14px;
  padding-top:18px;
  border-top:1px solid var(--ink);
  font-size:clamp(1.4rem,3.2vw,2rem);
  line-height:1.18;
  font-weight:700;
  letter-spacing:-.02em;
}

.prose small{
  display:block;
  margin-bottom:4px;
  font-size:14px;
  line-height:1.5;
  letter-spacing:.24em;
  font-weight:400;
  color:var(--mute);
}

.prose h3{
  margin:34px 0 10px;
  font-size:1.18rem;
  line-height:1.35;
  font-weight:600;
  letter-spacing:-.01em;
}

.prose p{margin:0 0 18px}

.prose ul,
.prose ol{
  margin:0 0 20px;
  padding-left:1.25em;
}

.prose li{margin:0 0 9px}

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

.prose a:hover{background:var(--soft)}

.prose figure{
  margin:26px 0;
  padding:10px;
  border:1px solid var(--ink);
  border-radius:18px;
}

.prose figure img{
  width:100%;
  height:auto;
  display:block;
  border-radius:12px;
}

.prose figcaption{
  margin-top:8px;
  font-size:15px;
  color:var(--mute);
}

.prose blockquote{
  margin:26px 0;
  padding:16px 20px;
  border:1px solid var(--ink);
  border-left-width:4px;
  border-radius:18px;
  background:var(--soft);
  font-weight:300;
}

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

.prose table{
  width:100%;
  margin:26px 0;
  border-collapse:collapse;
  font-size:16px;
  border:1px solid var(--ink);
  border-radius:18px;
  overflow:hidden;
}

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

.prose th{
  font-weight:600;
  background:var(--soft);
}

.prose code{
  font-family:ui-monospace,Menlo,Consolas,monospace;
  font-size:.92em;
  background:var(--soft);
  padding:1px 5px;
  border-radius:6px;
}

.prose hr{
  margin:36px 0;
  border:0;
  border-top:1px solid var(--line);
}

.prose > :first-child{margin-top:0}

/* ---------- foot ---------- */

.foot{
  margin-top:56px;
  padding:40px var(--edge) 26px;
  background:var(--ink);
  color:var(--paper);
}

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

.foot dl{
  margin:0;
  border-top:1px solid rgba(255,255,255,.3);
  padding-top:12px;
}

.foot dt{
  font-size:14px;
  line-height:1.5;
  letter-spacing:.24em;
  color:rgba(255,255,255,.66);
  margin-bottom:8px;
}

.foot dd{
  margin:0;
  font-size:16px;
  line-height:1.6;
}

.foot dd.fl a{
  display:block;
  padding:10px 0;
  min-height:42px;
  text-decoration:none;
  border-bottom:1px solid rgba(255,255,255,.16);
  transition:padding-left .2s ease;
}

.foot dd.fl a:hover{padding-left:8px}

.foot dd.nm{font-weight:600}

.sub{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.sub label{
  width:100%;
  font-size:14px;
  line-height:1.5;
  color:rgba(255,255,255,.66);
}

.sub input{
  flex:1 1 130px;
  min-width:0;
  padding:11px 14px;
  min-height:44px;
  font:inherit;
  font-size:16px;
  color:var(--paper);
  background:transparent;
  border:1px solid rgba(255,255,255,.55);
  border-radius:18px;
}

.sub input::placeholder{color:rgba(255,255,255,.5)}

.sub button{
  padding:11px 20px;
  min-height:44px;
  font:inherit;
  font-size:16px;
  color:var(--ink);
  background:var(--paper);
  border:1px solid var(--paper);
  border-radius:18px;
  cursor:pointer;
  transition:transform .2s ease;
}

.sub button:hover{transform:translate(-2px,-2px)}

.submsg{
  width:100%;
  margin:6px 0 0;
  font-size:14px;
  color:rgba(255,255,255,.7);
}

.copy{
  margin:30px 0 0;
  padding-top:16px;
  border-top:1px solid rgba(255,255,255,.16);
  font-size:14px;
  line-height:1.6;
  color:rgba(255,255,255,.6);
}

/* ---------- breakpoints ---------- */

@media (max-width:600px){
  .strip{letter-spacing:.14em}
  .nav a{padding:12px 8px;font-size:14px}
  .hero{min-height:52vh;clip-path:polygon(0 0,100% 0,100% calc(100% - 26px),0 100%)}
  .lead{font-size:16px}
  .prose{font-size:17px}
}

@media (min-width:900px){
  .hero{
    min-height:45vh;
    padding:calc(var(--unit)*8) var(--edge) calc(var(--unit)*10);
  }
  .herotext{grid-column:1 / span 9}
  .entry{
    grid-template-columns:230px minmax(0,1fr);
    column-gap:calc(var(--unit)*6);
    padding:56px var(--edge) 24px;
  }
  .side{position:sticky;top:calc(var(--head-h) + 16px)}
}

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

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,
  *::before,
  *::after{
    transition-duration:.001ms !important;
    animation-duration:.001ms !important;
  }
  .hero:hover .herofig .heromedia{transform:none}
}

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